Get-MgmtGraphDeviceCompliancePolicyUserStatusOverview
MgmtGraph: Audits user status overview for an Intune compliance policy
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.DeviceManagement
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$Identity
)
Process {
try {
$overview = Get-MgDeviceManagementDeviceCompliancePolicyUserStatusOverview -DeviceCompliancePolicyId $Identity -ErrorAction Stop
$result = [PSCustomObject]@{
PolicyId = $Identity
SuccessCount = $overview.SuccessCount
NotApplicableCount = $overview.NotApplicableCount
PendingCount = $overview.PendingCount
ErrorCount = $overview.ErrorCount
FailedCount = $overview.FailedCount
ConflictCount = $overview.ConflictCount
Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
}
Write-Output $result
}
catch {
throw
}
}Specifies the ID of the device compliance policy.