Menu

Intune with PowerShell 7: Compliance, Stale Devices and Autopilot
📰

Intune with PowerShell 7: Compliance, Stale Devices and Autopilot

DEV Community: azure·Anthony Buhnerkemper·about 12 hours ago
#2fp6cwYD
#devtoazure#devto#dev#toolkit#powershell
Reading 0:00
15s threshold

I have worked in IT for about 20 years. A lot of that was MSP operations. Today I work as an M365 cloud admin.

I kept writing the same scripts. So I cleaned them up and shared them on GitHub. This toolkit is for Microsoft Intune admins. It uses PowerShell 7 and the Microsoft.Graph SDK v2. Beta-only endpoints use Invoke-MgGraphRequest .

Repo: intune-powershell-toolkit

The problem it solves

Device lists get messy. Old laptops never check in again. Compliance reports in the portal are hard to export.

Autopilot imports by hand are slow when a box of new devices arrives.

These scripts make those jobs quick and repeatable.

Highlight scripts

Get-IntuneComplianceReport.ps1

Gives per-policy status counts and a list of non-compliant devices.

. / Get - IntuneComplianceReport . ps1

Enter fullscreen mode

Exit fullscreen mode

Remove-IntuneStaleDevice.ps1

Retires or deletes devices that have not checked in for a number of days. You can filter by OS. Always run with -WhatIf first.

.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.