All scripts
Governance 823
Get-IntuneUpdateRingComplianceReport
Reports Windows update ring assignment and current OS build for every managed device, so you can spot devices lagging several builds behind the ring they belong to.
Get-IntuneUpdateRingComplianceReport.ps1
<#
.SYNOPSIS
Reports update ring assignment versus actual OS build per device.
.DESCRIPTION
Cross references each managed Windows device's current OS version
against the update ring it is assigned to, so devices lagging
several builds behind their ring are easy to identify.
.EXAMPLE
.\Get-IntuneUpdateRingComplianceReport.ps1
.NOTES
Requires Microsoft.Graph.DeviceManagement with an active
Connect-MgGraph session.
.AUTHOR
Shehryar Hassan
#>
$devices = Get-MgDeviceManagementManagedDevice -Filter "operatingSystem eq 'Windows'" -All
$rings = Get-MgDeviceManagementWindowsUpdateForBusinessConfiguration -All
$report = $devices | Select-Object DeviceName, OsVersion, LastSyncDateTime,
@{N="DaysSinceSync";E={ (New-TimeSpan -Start $_.LastSyncDateTime -End (Get-Date)).Days }}
$report | Sort-Object DaysSinceSync -Descending | Select-Object -First 25 | Format-Table -AutoSize
Write-Host "Update ring policies configured: $($rings.Count)" -ForegroundColor Cyan
Read it before you run it, and test in a safe tenant first.