[{"data":1,"prerenderedAt":1963},["ShallowReactive",2],{"post:\u002F2025\u002F10\u002F22\u002Fpowershell-intune-force-a-compliance-policy-re-evaluation-fleet-wide\u002F":3},{"post":4,"newer":1921,"older":1932,"related":1942,"series":1961},{"id":5,"title":6,"body":7,"canonical":1903,"categories":1904,"date":1907,"description":1908,"extension":1909,"featured":1910,"hero":1911,"image":1911,"meta":1912,"navigation":798,"path":1913,"readingTime":455,"seo":1914,"series":1911,"seriesOrder":1911,"sites":1915,"source":1911,"stem":1916,"tags":1917,"updated":1911,"url":1919,"__hash__":1920},"blog\u002Fblog\u002F2025\u002F10\u002F22\u002Fpowershell-intune-force-a-compliance-policy-re-evaluation-fleet-wide.md","PowerShell: Intune – Force Compliance Re-Evaluation Fleet-Wide",{"type":8,"value":9,"toc":1895},"minimark",[10,32,37,95,99,221,225,228,256,259,293,296,304,307,376,388,551,555,1775,1779,1834,1838,1891],[11,12,13,14,18,19,23,24,27,28,31],"p",{},"After pushing a new or corrected compliance policy, the last thing I want is to wait out each device's normal check-in, which Microsoft estimates at about every 8 hours. Clicking ",[15,16,17],"strong",{},"Sync"," one device at a time in the Intune console doesn't scale past a handful of machines, and the console's bulk device actions handle up to 100 devices at a time. The same action is exposed through Microsoft Graph as ",[20,21,22],"code",{},"syncDevice"," on a managed device (",[20,25,26],{},"POST \u002FdeviceManagement\u002FmanagedDevices\u002F{id}\u002FsyncDevice",", v1.0), and the Graph PowerShell SDK wraps it as ",[20,29,30],{},"Sync-MgDeviceManagementManagedDevice",". This script pulls every managed device matching an OS and name filter, optionally only the ones not currently compliant, sends a sync to each with a delay between calls, and writes a CSV of what happened.",[33,34,36],"h2",{"id":35},"requirements","Requirements",[38,39,40,44,58,86,89,92],"ul",{},[41,42,43],"li",{},"PowerShell 7.x recommended (Windows PowerShell 5.1 works too).",[41,45,46,49,50,53,54,57],{},[20,47,48],{},"Microsoft.Graph.Authentication"," and ",[20,51,52],{},"Microsoft.Graph.DeviceManagement"," modules (",[20,55,56],{},"Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.DeviceManagement -Scope CurrentUser",").",[41,59,60,61,64,65],{},"Two delegated Graph permissions (the script signs in interactively with ",[20,62,63],{},"Connect-MgGraph -Scopes","; running it app-only would need a certificate or managed-identity sign-in and the same two as application permissions):\n",[38,66,67,76],{},[41,68,69,72,73,75],{},[20,70,71],{},"DeviceManagementManagedDevices.PrivilegedOperations.All",": the only permission ",[20,74,22],{}," accepts.",[41,77,78,81,82,85],{},[20,79,80],{},"DeviceManagementManagedDevices.Read.All",": needed to list devices with ",[20,83,84],{},"Get-MgDeviceManagementManagedDevice",". The privileged-operations permission doesn't include read access, and the first version of this script only requested that one, so the device query failed.",[41,87,88],{},"An Intune role for the signed-in identity that allows the remote sync task (Intune Administrator, or a custom role with that remote task).",[41,90,91],{},"An active Intune license on the tenant (a stated requirement of the Intune Graph API).",[41,93,94],{},"Devices need to be online and reachable through their platform's push service to act on the request immediately. An offline device picks it up the next time it checks in.",[33,96,98],{"id":97},"parameters","Parameters",[100,101,102,121],"table",{},[103,104,105],"thead",{},[106,107,108,112,115,118],"tr",{},[109,110,111],"th",{},"Name",[109,113,114],{},"Type",[109,116,117],{},"Required",[109,119,120],{},"Description",[122,123,124,149,167,189,207],"tbody",{},[106,125,126,132,135,138],{},[127,128,129],"td",{},[20,130,131],{},"-OperatingSystem",[127,133,134],{},"String",[127,136,137],{},"No",[127,139,140,141,144,145,148],{},"Managed device ",[20,142,143],{},"operatingSystem"," value to target. Defaults to ",[20,146,147],{},"Windows",".",[106,150,151,156,158,160],{},[127,152,153],{},[20,154,155],{},"-DeviceNamePattern",[127,157,134],{},[127,159,137],{},[127,161,162,163,166],{},"Wildcard pattern matched against the device name. Defaults to ",[20,164,165],{},"*"," (every device).",[106,168,169,174,177,179],{},[127,170,171],{},[20,172,173],{},"-OnlyNonCompliant",[127,175,176],{},"Switch",[127,178,137],{},[127,180,181,182,185,186,148],{},"Skips devices whose ",[20,183,184],{},"complianceState"," is already ",[20,187,188],{},"compliant",[106,190,191,196,199,201],{},[127,192,193],{},[20,194,195],{},"-ThrottleMs",[127,197,198],{},"Int",[127,200,137],{},[127,202,203,204,148],{},"Delay in milliseconds between sync calls. Defaults to ",[20,205,206],{},"500",[106,208,209,214,216,218],{},[127,210,211],{},[20,212,213],{},"-ReportPath",[127,215,134],{},[127,217,137],{},[127,219,220],{},"Path to the CSV report written after the run. Defaults to a timestamped file in the current directory.",[33,222,224],{"id":223},"usage","Usage",[11,226,227],{},"Preview which devices would be synced without calling the action:",[229,230,235],"pre",{"className":231,"code":232,"language":233,"meta":234,"style":234},"language-powershell shiki shiki-themes github-dark",".\\Invoke-FleetComplianceResync.ps1 -WhatIf\n","powershell","",[20,236,237],{"__ignoreMap":234},[238,239,242,245,249,253],"span",{"class":240,"line":241},"line",1,[238,243,148],{"class":244},"s95oV",[238,246,248],{"class":247},"sDLfK","\\Invoke-FleetComplianceResync.ps1",[238,250,252],{"class":251},"snl16"," -",[238,254,255],{"class":244},"WhatIf\n",[11,257,258],{},"After fixing a compliance policy, resync only the laptops that are currently failing it:",[229,260,262],{"className":231,"code":261,"language":233,"meta":234,"style":234},".\\Invoke-FleetComplianceResync.ps1 -DeviceNamePattern \"LAPTOP-*\" -OnlyNonCompliant -ThrottleMs 750\n",[20,263,264],{"__ignoreMap":234},[238,265,266,268,270,272,275,279,281,284,287,290],{"class":240,"line":241},[238,267,148],{"class":244},[238,269,248],{"class":247},[238,271,252],{"class":251},[238,273,274],{"class":244},"DeviceNamePattern ",[238,276,278],{"class":277},"sU2Wk","\"LAPTOP-*\"",[238,280,252],{"class":251},[238,282,283],{"class":244},"OnlyNonCompliant ",[238,285,286],{"class":251},"-",[238,288,289],{"class":244},"ThrottleMs ",[238,291,292],{"class":247},"750\n",[11,294,295],{},"Sample output:",[229,297,302],{"className":298,"code":300,"language":301,"meta":234},[299],"language-text","Fetching managed devices (OS: Windows, name pattern: LAPTOP-*)...\n214 device(s) matched, 37 after the compliance filter.\nSync requested for 37 device(s), 1 failed. Report: .\\fleet-sync-report-20251022-090512.csv\n","text",[20,303,300],{"__ignoreMap":234},[11,305,306],{},"Look at failures afterwards:",[229,308,310],{"className":231,"code":309,"language":233,"meta":234,"style":234},"Import-Csv .\\fleet-sync-report-20251022-090512.csv | Where-Object { $_.Status -eq \"Failed\" } | Format-Table DeviceName, Error\n",[20,311,312],{"__ignoreMap":234},[238,313,314,317,320,322,325,327,330,332,335,338,341,344,347,350,353,356,359,362,364,367,370,373],{"class":240,"line":241},[238,315,316],{"class":247},"Import-Csv",[238,318,319],{"class":244}," .\\fleet",[238,321,286],{"class":251},[238,323,324],{"class":247},"sync-report",[238,326,286],{"class":251},[238,328,329],{"class":247},"20251022",[238,331,286],{"class":251},[238,333,334],{"class":247},"090512.",[238,336,337],{"class":244},"csv ",[238,339,340],{"class":251},"|",[238,342,343],{"class":247}," Where-Object",[238,345,346],{"class":244}," { ",[238,348,349],{"class":247},"$_",[238,351,352],{"class":244},".Status ",[238,354,355],{"class":251},"-eq",[238,357,358],{"class":277}," \"Failed\"",[238,360,361],{"class":244}," } ",[238,363,340],{"class":251},[238,365,366],{"class":247}," Format-Table",[238,368,369],{"class":244}," DeviceName",[238,371,372],{"class":251},",",[238,374,375],{"class":244}," Error\n",[11,377,378,379,382,383,387],{},"Confirm the devices actually checked in. ",[20,380,381],{},"LastSyncDateTime"," in the report is the value from ",[384,385,386],"em",{},"before"," the sync, so compare it with a fresh read an hour later:",[229,389,391],{"className":231,"code":390,"language":233,"meta":234,"style":234},"$before = Import-Csv .\\fleet-sync-report-20251022-090512.csv | Where-Object { $_.Status -eq \"Synced\" }\nforeach ($row in $before) {\n    $now = Get-MgDeviceManagementManagedDevice -ManagedDeviceId $row.DeviceId -Property \"deviceName,lastSyncDateTime,complianceState\"\n    [PSCustomObject]@{\n        DeviceName      = $now.DeviceName\n        SyncedBefore    = $row.LastSyncDateTime\n        SyncedNow       = $now.LastSyncDateTime\n        ComplianceState = $now.ComplianceState\n    }\n}\n",[20,392,393,438,453,477,495,506,517,528,539,545],{"__ignoreMap":234},[238,394,395,398,401,404,406,408,410,412,414,416,418,420,422,424,426,428,430,432,435],{"class":240,"line":241},[238,396,397],{"class":244},"$before ",[238,399,400],{"class":251},"=",[238,402,403],{"class":247}," Import-Csv",[238,405,319],{"class":244},[238,407,286],{"class":251},[238,409,324],{"class":247},[238,411,286],{"class":251},[238,413,329],{"class":247},[238,415,286],{"class":251},[238,417,334],{"class":247},[238,419,337],{"class":244},[238,421,340],{"class":251},[238,423,343],{"class":247},[238,425,346],{"class":244},[238,427,349],{"class":247},[238,429,352],{"class":244},[238,431,355],{"class":251},[238,433,434],{"class":277}," \"Synced\"",[238,436,437],{"class":244}," }\n",[238,439,441,444,447,450],{"class":240,"line":440},2,[238,442,443],{"class":251},"foreach",[238,445,446],{"class":244}," ($row ",[238,448,449],{"class":251},"in",[238,451,452],{"class":244}," $before) {\n",[238,454,456,459,461,464,466,469,471,474],{"class":240,"line":455},3,[238,457,458],{"class":244},"    $now ",[238,460,400],{"class":251},[238,462,463],{"class":247}," Get-MgDeviceManagementManagedDevice",[238,465,252],{"class":251},[238,467,468],{"class":244},"ManagedDeviceId $row.DeviceId ",[238,470,286],{"class":251},[238,472,473],{"class":244},"Property ",[238,475,476],{"class":277},"\"deviceName,lastSyncDateTime,complianceState\"\n",[238,478,480,483,486,489,492],{"class":240,"line":479},4,[238,481,482],{"class":244},"    [",[238,484,485],{"class":251},"PSCustomObject",[238,487,488],{"class":244},"]",[238,490,491],{"class":251},"@",[238,493,494],{"class":244},"{\n",[238,496,498,501,503],{"class":240,"line":497},5,[238,499,500],{"class":244},"        DeviceName      ",[238,502,400],{"class":251},[238,504,505],{"class":244}," $now.DeviceName\n",[238,507,509,512,514],{"class":240,"line":508},6,[238,510,511],{"class":244},"        SyncedBefore    ",[238,513,400],{"class":251},[238,515,516],{"class":244}," $row.LastSyncDateTime\n",[238,518,520,523,525],{"class":240,"line":519},7,[238,521,522],{"class":244},"        SyncedNow       ",[238,524,400],{"class":251},[238,526,527],{"class":244}," $now.LastSyncDateTime\n",[238,529,531,534,536],{"class":240,"line":530},8,[238,532,533],{"class":244},"        ComplianceState ",[238,535,400],{"class":251},[238,537,538],{"class":244}," $now.ComplianceState\n",[238,540,542],{"class":240,"line":541},9,[238,543,544],{"class":244},"    }\n",[238,546,548],{"class":240,"line":547},10,[238,549,550],{"class":244},"}\n",[33,552,554],{"id":553},"script","Script",[229,556,558],{"className":231,"code":557,"language":233,"meta":234,"style":234},"\u003C#\n.SYNOPSIS\n    Sends the Intune syncDevice action to every matching managed device so\n    compliance and configuration policy are re-evaluated immediately.\n.DESCRIPTION\n    Connects to Microsoft Graph, lists managed devices that match the operating\n    system and device name filters (optionally only those not compliant), and\n    calls Sync-MgDeviceManagementManagedDevice (the v1.0 syncDevice action) on\n    each one. The sync makes the device check in with Intune now instead of at\n    its next scheduled check-in. Calls are spaced by -ThrottleMs, a throttled\n    call (HTTP 429) is retried once after a back-off, and the result of each\n    call is written to a CSV report. Supports -WhatIf.\n.PARAMETER OperatingSystem\n    Managed device operatingSystem value to target. Defaults to Windows.\n.PARAMETER DeviceNamePattern\n    Wildcard pattern matched against the device name. Defaults to * (every device).\n.PARAMETER OnlyNonCompliant\n    Skips devices whose complianceState is already compliant.\n.PARAMETER ThrottleMs\n    Delay in milliseconds between sync calls. Defaults to 500.\n.PARAMETER ReportPath\n    Path to the CSV report written after the run.\n.EXAMPLE\n    .\\Invoke-FleetComplianceResync.ps1 -WhatIf\n.EXAMPLE\n    .\\Invoke-FleetComplianceResync.ps1 -DeviceNamePattern \"LAPTOP-*\" -OnlyNonCompliant -ThrottleMs 750\n.NOTES\n    Author  : Thomas Lasswell (https:\u002F\u002Fwww.techcolumnist.com)\n    Version : 1.0 (2025-10-22)\n    Requires: Microsoft.Graph.Authentication, Microsoft.Graph.DeviceManagement;\n              DeviceManagementManagedDevices.Read.All and\n              DeviceManagementManagedDevices.PrivilegedOperations.All.\n.LINK\n    https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fgraph\u002Fapi\u002Fintune-devices-manageddevice-syncdevice?view=graph-rest-1.0\n#>\n\n[CmdletBinding(SupportsShouldProcess = $true)]\nparam (\n    [Parameter()]\n    [string]$OperatingSystem = \"Windows\",\n\n    [Parameter()]\n    [string]$DeviceNamePattern = \"*\",\n\n    [Parameter()]\n    [switch]$OnlyNonCompliant,\n\n    [Parameter()]\n    [int]$ThrottleMs = 500,\n\n    [Parameter()]\n    [string]$ReportPath = \".\\fleet-sync-report-$(Get-Date -Format 'yyyyMMdd-HHmmss').csv\"\n)\n\nImport-Module Microsoft.Graph.Authentication\nImport-Module Microsoft.Graph.DeviceManagement\n\nConnect-MgGraph -Scopes \"DeviceManagementManagedDevices.Read.All\", \"DeviceManagementManagedDevices.PrivilegedOperations.All\" -NoWelcome\n\nWrite-Host \"Fetching managed devices (OS: $OperatingSystem, name pattern: $DeviceNamePattern)...\"\n\n$escapedOs = $OperatingSystem.Replace(\"'\", \"''\")\n$devices = @(Get-MgDeviceManagementManagedDevice -All -Filter \"operatingSystem eq '$escapedOs'\" -Property \"id,deviceName,complianceState,lastSyncDateTime,operatingSystem\" |\n    Where-Object { $_.DeviceName -like $DeviceNamePattern })\n$matchedCount = $devices.Count\n\nif ($OnlyNonCompliant) {\n    $devices = @($devices | Where-Object { $_.ComplianceState -ne \"compliant\" })\n}\n\nWrite-Host \"$matchedCount device(s) matched, $($devices.Count) after the compliance filter.\"\n\n$results = foreach ($device in $devices) {\n    $status = \"Skipped\"\n    $errorMessage = $null\n\n    if ($PSCmdlet.ShouldProcess($device.DeviceName, \"Sync-MgDeviceManagementManagedDevice\")) {\n        $attempt = 0\n        while ($status -ne \"Synced\" -and $attempt -lt 2) {\n            $attempt++\n            try {\n                Sync-MgDeviceManagementManagedDevice -ManagedDeviceId $device.Id -ErrorAction Stop\n                $status = \"Synced\"\n                $errorMessage = $null\n            } catch {\n                $status = \"Failed\"\n                $errorMessage = $_.Exception.Message\n                if ($errorMessage -match \"TooManyRequests|429\" -and $attempt -lt 2) {\n                    # Back off once when Graph throttles the call, then retry.\n                    Start-Sleep -Seconds 30\n                } else {\n                    break\n                }\n            }\n        }\n\n        Start-Sleep -Milliseconds $ThrottleMs\n    }\n\n    [PSCustomObject]@{\n        DeviceName       = $device.DeviceName\n        DeviceId         = $device.Id\n        ComplianceState  = $device.ComplianceState\n        LastSyncDateTime = $device.LastSyncDateTime\n        Status           = $status\n        Error            = $errorMessage\n    }\n}\n\n$results | Export-Csv -Path $ReportPath -NoTypeInformation -Encoding utf8\n\n$failed = @($results | Where-Object { $_.Status -eq \"Failed\" })\nWrite-Host \"Sync requested for $(@($results).Count) device(s), $($failed.Count) failed. Report: $ReportPath\"\n",[20,559,560,566,573,578,583,590,595,600,605,610,615,621,627,638,644,654,660,670,676,686,692,702,708,716,722,729,735,743,749,755,761,767,773,781,787,793,800,825,834,845,864,869,878,895,900,909,922,927,936,954,959,968,1005,1011,1016,1025,1033,1038,1062,1067,1088,1093,1114,1158,1177,1188,1193,1202,1235,1240,1245,1271,1276,1295,1306,1317,1322,1345,1356,1384,1393,1402,1418,1429,1439,1450,1460,1473,1498,1504,1518,1529,1535,1541,1547,1553,1558,1569,1574,1579,1592,1603,1614,1625,1636,1647,1658,1663,1668,1673,1698,1703,1732],{"__ignoreMap":234},[238,561,562],{"class":240,"line":241},[238,563,565],{"class":564},"sAwPA","\u003C#\n",[238,567,568,570],{"class":240,"line":440},[238,569,148],{"class":247},[238,571,572],{"class":251},"SYNOPSIS\n",[238,574,575],{"class":240,"line":455},[238,576,577],{"class":564},"    Sends the Intune syncDevice action to every matching managed device so\n",[238,579,580],{"class":240,"line":479},[238,581,582],{"class":564},"    compliance and configuration policy are re-evaluated immediately.\n",[238,584,585,587],{"class":240,"line":497},[238,586,148],{"class":247},[238,588,589],{"class":251},"DESCRIPTION\n",[238,591,592],{"class":240,"line":508},[238,593,594],{"class":564},"    Connects to Microsoft Graph, lists managed devices that match the operating\n",[238,596,597],{"class":240,"line":519},[238,598,599],{"class":564},"    system and device name filters (optionally only those not compliant), and\n",[238,601,602],{"class":240,"line":530},[238,603,604],{"class":564},"    calls Sync-MgDeviceManagementManagedDevice (the v1.0 syncDevice action) on\n",[238,606,607],{"class":240,"line":541},[238,608,609],{"class":564},"    each one. The sync makes the device check in with Intune now instead of at\n",[238,611,612],{"class":240,"line":547},[238,613,614],{"class":564},"    its next scheduled check-in. Calls are spaced by -ThrottleMs, a throttled\n",[238,616,618],{"class":240,"line":617},11,[238,619,620],{"class":564},"    call (HTTP 429) is retried once after a back-off, and the result of each\n",[238,622,624],{"class":240,"line":623},12,[238,625,626],{"class":564},"    call is written to a CSV report. Supports -WhatIf.\n",[238,628,630,632,635],{"class":240,"line":629},13,[238,631,148],{"class":247},[238,633,634],{"class":251},"PARAMETER",[238,636,637],{"class":251}," OperatingSystem\n",[238,639,641],{"class":240,"line":640},14,[238,642,643],{"class":564},"    Managed device operatingSystem value to target. Defaults to Windows.\n",[238,645,647,649,651],{"class":240,"line":646},15,[238,648,148],{"class":247},[238,650,634],{"class":251},[238,652,653],{"class":251}," DeviceNamePattern\n",[238,655,657],{"class":240,"line":656},16,[238,658,659],{"class":564},"    Wildcard pattern matched against the device name. Defaults to * (every device).\n",[238,661,663,665,667],{"class":240,"line":662},17,[238,664,148],{"class":247},[238,666,634],{"class":251},[238,668,669],{"class":251}," OnlyNonCompliant\n",[238,671,673],{"class":240,"line":672},18,[238,674,675],{"class":564},"    Skips devices whose complianceState is already compliant.\n",[238,677,679,681,683],{"class":240,"line":678},19,[238,680,148],{"class":247},[238,682,634],{"class":251},[238,684,685],{"class":251}," ThrottleMs\n",[238,687,689],{"class":240,"line":688},20,[238,690,691],{"class":564},"    Delay in milliseconds between sync calls. Defaults to 500.\n",[238,693,695,697,699],{"class":240,"line":694},21,[238,696,148],{"class":247},[238,698,634],{"class":251},[238,700,701],{"class":251}," ReportPath\n",[238,703,705],{"class":240,"line":704},22,[238,706,707],{"class":564},"    Path to the CSV report written after the run.\n",[238,709,711,713],{"class":240,"line":710},23,[238,712,148],{"class":247},[238,714,715],{"class":251},"EXAMPLE\n",[238,717,719],{"class":240,"line":718},24,[238,720,721],{"class":564},"    .\\Invoke-FleetComplianceResync.ps1 -WhatIf\n",[238,723,725,727],{"class":240,"line":724},25,[238,726,148],{"class":247},[238,728,715],{"class":251},[238,730,732],{"class":240,"line":731},26,[238,733,734],{"class":564},"    .\\Invoke-FleetComplianceResync.ps1 -DeviceNamePattern \"LAPTOP-*\" -OnlyNonCompliant -ThrottleMs 750\n",[238,736,738,740],{"class":240,"line":737},27,[238,739,148],{"class":247},[238,741,742],{"class":251},"NOTES\n",[238,744,746],{"class":240,"line":745},28,[238,747,748],{"class":564},"    Author  : Thomas Lasswell (https:\u002F\u002Fwww.techcolumnist.com)\n",[238,750,752],{"class":240,"line":751},29,[238,753,754],{"class":564},"    Version : 1.0 (2025-10-22)\n",[238,756,758],{"class":240,"line":757},30,[238,759,760],{"class":564},"    Requires: Microsoft.Graph.Authentication, Microsoft.Graph.DeviceManagement;\n",[238,762,764],{"class":240,"line":763},31,[238,765,766],{"class":564},"              DeviceManagementManagedDevices.Read.All and\n",[238,768,770],{"class":240,"line":769},32,[238,771,772],{"class":564},"              DeviceManagementManagedDevices.PrivilegedOperations.All.\n",[238,774,776,778],{"class":240,"line":775},33,[238,777,148],{"class":247},[238,779,780],{"class":251},"LINK\n",[238,782,784],{"class":240,"line":783},34,[238,785,786],{"class":564},"    https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fgraph\u002Fapi\u002Fintune-devices-manageddevice-syncdevice?view=graph-rest-1.0\n",[238,788,790],{"class":240,"line":789},35,[238,791,792],{"class":564},"#>\n",[238,794,796],{"class":240,"line":795},36,[238,797,799],{"emptyLinePlaceholder":798},true,"\n",[238,801,803,806,809,812,816,819,822],{"class":240,"line":802},37,[238,804,805],{"class":244},"[",[238,807,808],{"class":247},"CmdletBinding",[238,810,811],{"class":244},"(",[238,813,815],{"class":814},"s9osk","SupportsShouldProcess",[238,817,818],{"class":251}," =",[238,820,821],{"class":247}," $true",[238,823,824],{"class":244},")]\n",[238,826,828,831],{"class":240,"line":827},38,[238,829,830],{"class":251},"param",[238,832,833],{"class":244}," (\n",[238,835,837,839,842],{"class":240,"line":836},39,[238,838,482],{"class":244},[238,840,841],{"class":247},"Parameter",[238,843,844],{"class":244},"()]\n",[238,846,848,850,853,856,858,861],{"class":240,"line":847},40,[238,849,482],{"class":244},[238,851,852],{"class":251},"string",[238,854,855],{"class":244},"]$OperatingSystem ",[238,857,400],{"class":251},[238,859,860],{"class":277}," \"Windows\"",[238,862,863],{"class":251},",\n",[238,865,867],{"class":240,"line":866},41,[238,868,799],{"emptyLinePlaceholder":798},[238,870,872,874,876],{"class":240,"line":871},42,[238,873,482],{"class":244},[238,875,841],{"class":247},[238,877,844],{"class":244},[238,879,881,883,885,888,890,893],{"class":240,"line":880},43,[238,882,482],{"class":244},[238,884,852],{"class":251},[238,886,887],{"class":244},"]$DeviceNamePattern ",[238,889,400],{"class":251},[238,891,892],{"class":277}," \"*\"",[238,894,863],{"class":251},[238,896,898],{"class":240,"line":897},44,[238,899,799],{"emptyLinePlaceholder":798},[238,901,903,905,907],{"class":240,"line":902},45,[238,904,482],{"class":244},[238,906,841],{"class":247},[238,908,844],{"class":244},[238,910,912,914,917,920],{"class":240,"line":911},46,[238,913,482],{"class":244},[238,915,916],{"class":251},"switch",[238,918,919],{"class":244},"]$OnlyNonCompliant",[238,921,863],{"class":251},[238,923,925],{"class":240,"line":924},47,[238,926,799],{"emptyLinePlaceholder":798},[238,928,930,932,934],{"class":240,"line":929},48,[238,931,482],{"class":244},[238,933,841],{"class":247},[238,935,844],{"class":244},[238,937,939,941,944,947,949,952],{"class":240,"line":938},49,[238,940,482],{"class":244},[238,942,943],{"class":251},"int",[238,945,946],{"class":244},"]$ThrottleMs ",[238,948,400],{"class":251},[238,950,951],{"class":247}," 500",[238,953,863],{"class":251},[238,955,957],{"class":240,"line":956},50,[238,958,799],{"emptyLinePlaceholder":798},[238,960,962,964,966],{"class":240,"line":961},51,[238,963,482],{"class":244},[238,965,841],{"class":247},[238,967,844],{"class":244},[238,969,971,973,975,978,980,983,986,988,991,993,996,999,1002],{"class":240,"line":970},52,[238,972,482],{"class":244},[238,974,852],{"class":251},[238,976,977],{"class":244},"]$ReportPath ",[238,979,400],{"class":251},[238,981,982],{"class":277}," \".\\fleet-sync-report-",[238,984,985],{"class":251},"$",[238,987,811],{"class":277},[238,989,990],{"class":247},"Get-Date",[238,992,252],{"class":251},[238,994,995],{"class":277},"Format ",[238,997,998],{"class":277},"'yyyyMMdd-HHmmss'",[238,1000,1001],{"class":277},")",[238,1003,1004],{"class":277},".csv\"\n",[238,1006,1008],{"class":240,"line":1007},53,[238,1009,1010],{"class":244},")\n",[238,1012,1014],{"class":240,"line":1013},54,[238,1015,799],{"emptyLinePlaceholder":798},[238,1017,1019,1022],{"class":240,"line":1018},55,[238,1020,1021],{"class":247},"Import-Module",[238,1023,1024],{"class":244}," Microsoft.Graph.Authentication\n",[238,1026,1028,1030],{"class":240,"line":1027},56,[238,1029,1021],{"class":247},[238,1031,1032],{"class":244}," Microsoft.Graph.DeviceManagement\n",[238,1034,1036],{"class":240,"line":1035},57,[238,1037,799],{"emptyLinePlaceholder":798},[238,1039,1041,1044,1046,1049,1052,1054,1057,1059],{"class":240,"line":1040},58,[238,1042,1043],{"class":247},"Connect-MgGraph",[238,1045,252],{"class":251},[238,1047,1048],{"class":244},"Scopes ",[238,1050,1051],{"class":277},"\"DeviceManagementManagedDevices.Read.All\"",[238,1053,372],{"class":251},[238,1055,1056],{"class":277}," \"DeviceManagementManagedDevices.PrivilegedOperations.All\"",[238,1058,252],{"class":251},[238,1060,1061],{"class":244},"NoWelcome\n",[238,1063,1065],{"class":240,"line":1064},59,[238,1066,799],{"emptyLinePlaceholder":798},[238,1068,1070,1073,1076,1079,1082,1085],{"class":240,"line":1069},60,[238,1071,1072],{"class":247},"Write-Host",[238,1074,1075],{"class":277}," \"Fetching managed devices (OS: ",[238,1077,1078],{"class":244},"$OperatingSystem",[238,1080,1081],{"class":277},", name pattern: ",[238,1083,1084],{"class":244},"$DeviceNamePattern",[238,1086,1087],{"class":277},")...\"\n",[238,1089,1091],{"class":240,"line":1090},61,[238,1092,799],{"emptyLinePlaceholder":798},[238,1094,1096,1099,1101,1104,1107,1109,1112],{"class":240,"line":1095},62,[238,1097,1098],{"class":244},"$escapedOs ",[238,1100,400],{"class":251},[238,1102,1103],{"class":244}," $OperatingSystem.Replace(",[238,1105,1106],{"class":277},"\"'\"",[238,1108,372],{"class":251},[238,1110,1111],{"class":277}," \"''\"",[238,1113,1010],{"class":244},[238,1115,1117,1120,1122,1125,1127,1129,1131,1134,1136,1139,1142,1145,1148,1150,1152,1155],{"class":240,"line":1116},63,[238,1118,1119],{"class":244},"$devices ",[238,1121,400],{"class":251},[238,1123,1124],{"class":251}," @",[238,1126,811],{"class":244},[238,1128,84],{"class":247},[238,1130,252],{"class":251},[238,1132,1133],{"class":244},"All ",[238,1135,286],{"class":251},[238,1137,1138],{"class":244},"Filter ",[238,1140,1141],{"class":277},"\"operatingSystem eq '",[238,1143,1144],{"class":244},"$escapedOs",[238,1146,1147],{"class":277},"'\"",[238,1149,252],{"class":251},[238,1151,473],{"class":244},[238,1153,1154],{"class":277},"\"id,deviceName,complianceState,lastSyncDateTime,operatingSystem\"",[238,1156,1157],{"class":251}," |\n",[238,1159,1161,1164,1166,1168,1171,1174],{"class":240,"line":1160},64,[238,1162,1163],{"class":247},"    Where-Object",[238,1165,346],{"class":244},[238,1167,349],{"class":247},[238,1169,1170],{"class":244},".DeviceName ",[238,1172,1173],{"class":251},"-like",[238,1175,1176],{"class":244}," $DeviceNamePattern })\n",[238,1178,1180,1183,1185],{"class":240,"line":1179},65,[238,1181,1182],{"class":244},"$matchedCount ",[238,1184,400],{"class":251},[238,1186,1187],{"class":244}," $devices.Count\n",[238,1189,1191],{"class":240,"line":1190},66,[238,1192,799],{"emptyLinePlaceholder":798},[238,1194,1196,1199],{"class":240,"line":1195},67,[238,1197,1198],{"class":251},"if",[238,1200,1201],{"class":244}," ($OnlyNonCompliant) {\n",[238,1203,1205,1208,1210,1212,1215,1217,1219,1221,1223,1226,1229,1232],{"class":240,"line":1204},68,[238,1206,1207],{"class":244},"    $devices ",[238,1209,400],{"class":251},[238,1211,1124],{"class":251},[238,1213,1214],{"class":244},"($devices ",[238,1216,340],{"class":251},[238,1218,343],{"class":247},[238,1220,346],{"class":244},[238,1222,349],{"class":247},[238,1224,1225],{"class":244},".ComplianceState ",[238,1227,1228],{"class":251},"-ne",[238,1230,1231],{"class":277}," \"compliant\"",[238,1233,1234],{"class":244}," })\n",[238,1236,1238],{"class":240,"line":1237},69,[238,1239,550],{"class":244},[238,1241,1243],{"class":240,"line":1242},70,[238,1244,799],{"emptyLinePlaceholder":798},[238,1246,1248,1250,1253,1256,1259,1261,1263,1266,1268],{"class":240,"line":1247},71,[238,1249,1072],{"class":247},[238,1251,1252],{"class":277}," \"",[238,1254,1255],{"class":244},"$matchedCount",[238,1257,1258],{"class":277}," device(s) matched, ",[238,1260,985],{"class":251},[238,1262,811],{"class":277},[238,1264,1265],{"class":244},"$devices.Count",[238,1267,1001],{"class":277},[238,1269,1270],{"class":277}," after the compliance filter.\"\n",[238,1272,1274],{"class":240,"line":1273},72,[238,1275,799],{"emptyLinePlaceholder":798},[238,1277,1279,1282,1284,1287,1290,1292],{"class":240,"line":1278},73,[238,1280,1281],{"class":244},"$results ",[238,1283,400],{"class":251},[238,1285,1286],{"class":251}," foreach",[238,1288,1289],{"class":244}," ($device ",[238,1291,449],{"class":251},[238,1293,1294],{"class":244}," $devices) {\n",[238,1296,1298,1301,1303],{"class":240,"line":1297},74,[238,1299,1300],{"class":244},"    $status ",[238,1302,400],{"class":251},[238,1304,1305],{"class":277}," \"Skipped\"\n",[238,1307,1309,1312,1314],{"class":240,"line":1308},75,[238,1310,1311],{"class":244},"    $errorMessage ",[238,1313,400],{"class":251},[238,1315,1316],{"class":247}," $null\n",[238,1318,1320],{"class":240,"line":1319},76,[238,1321,799],{"emptyLinePlaceholder":798},[238,1323,1325,1328,1331,1334,1337,1339,1342],{"class":240,"line":1324},77,[238,1326,1327],{"class":251},"    if",[238,1329,1330],{"class":244}," (",[238,1332,1333],{"class":247},"$PSCmdlet",[238,1335,1336],{"class":244},".ShouldProcess($device.DeviceName",[238,1338,372],{"class":251},[238,1340,1341],{"class":277}," \"Sync-MgDeviceManagementManagedDevice\"",[238,1343,1344],{"class":244},")) {\n",[238,1346,1348,1351,1353],{"class":240,"line":1347},78,[238,1349,1350],{"class":244},"        $attempt ",[238,1352,400],{"class":251},[238,1354,1355],{"class":247}," 0\n",[238,1357,1359,1362,1365,1367,1369,1372,1375,1378,1381],{"class":240,"line":1358},79,[238,1360,1361],{"class":251},"        while",[238,1363,1364],{"class":244}," ($status ",[238,1366,1228],{"class":251},[238,1368,434],{"class":277},[238,1370,1371],{"class":251}," -and",[238,1373,1374],{"class":244}," $attempt ",[238,1376,1377],{"class":251},"-lt",[238,1379,1380],{"class":247}," 2",[238,1382,1383],{"class":244},") {\n",[238,1385,1387,1390],{"class":240,"line":1386},80,[238,1388,1389],{"class":244},"            $attempt",[238,1391,1392],{"class":251},"++\n",[238,1394,1396,1399],{"class":240,"line":1395},81,[238,1397,1398],{"class":251},"            try",[238,1400,1401],{"class":244}," {\n",[238,1403,1405,1408,1410,1413,1415],{"class":240,"line":1404},82,[238,1406,1407],{"class":247},"                Sync-MgDeviceManagementManagedDevice",[238,1409,252],{"class":251},[238,1411,1412],{"class":244},"ManagedDeviceId $device.Id ",[238,1414,286],{"class":251},[238,1416,1417],{"class":244},"ErrorAction Stop\n",[238,1419,1421,1424,1426],{"class":240,"line":1420},83,[238,1422,1423],{"class":244},"                $status ",[238,1425,400],{"class":251},[238,1427,1428],{"class":277}," \"Synced\"\n",[238,1430,1432,1435,1437],{"class":240,"line":1431},84,[238,1433,1434],{"class":244},"                $errorMessage ",[238,1436,400],{"class":251},[238,1438,1316],{"class":247},[238,1440,1442,1445,1448],{"class":240,"line":1441},85,[238,1443,1444],{"class":244},"            } ",[238,1446,1447],{"class":251},"catch",[238,1449,1401],{"class":244},[238,1451,1453,1455,1457],{"class":240,"line":1452},86,[238,1454,1423],{"class":244},[238,1456,400],{"class":251},[238,1458,1459],{"class":277}," \"Failed\"\n",[238,1461,1463,1465,1467,1470],{"class":240,"line":1462},87,[238,1464,1434],{"class":244},[238,1466,400],{"class":251},[238,1468,1469],{"class":247}," $_",[238,1471,1472],{"class":244},".Exception.Message\n",[238,1474,1476,1479,1482,1485,1488,1490,1492,1494,1496],{"class":240,"line":1475},88,[238,1477,1478],{"class":251},"                if",[238,1480,1481],{"class":244}," ($errorMessage ",[238,1483,1484],{"class":251},"-match",[238,1486,1487],{"class":277}," \"TooManyRequests|429\"",[238,1489,1371],{"class":251},[238,1491,1374],{"class":244},[238,1493,1377],{"class":251},[238,1495,1380],{"class":247},[238,1497,1383],{"class":244},[238,1499,1501],{"class":240,"line":1500},89,[238,1502,1503],{"class":564},"                    # Back off once when Graph throttles the call, then retry.\n",[238,1505,1507,1510,1512,1515],{"class":240,"line":1506},90,[238,1508,1509],{"class":247},"                    Start-Sleep",[238,1511,252],{"class":251},[238,1513,1514],{"class":244},"Seconds ",[238,1516,1517],{"class":247},"30\n",[238,1519,1521,1524,1527],{"class":240,"line":1520},91,[238,1522,1523],{"class":244},"                } ",[238,1525,1526],{"class":251},"else",[238,1528,1401],{"class":244},[238,1530,1532],{"class":240,"line":1531},92,[238,1533,1534],{"class":251},"                    break\n",[238,1536,1538],{"class":240,"line":1537},93,[238,1539,1540],{"class":244},"                }\n",[238,1542,1544],{"class":240,"line":1543},94,[238,1545,1546],{"class":244},"            }\n",[238,1548,1550],{"class":240,"line":1549},95,[238,1551,1552],{"class":244},"        }\n",[238,1554,1556],{"class":240,"line":1555},96,[238,1557,799],{"emptyLinePlaceholder":798},[238,1559,1561,1564,1566],{"class":240,"line":1560},97,[238,1562,1563],{"class":247},"        Start-Sleep",[238,1565,252],{"class":251},[238,1567,1568],{"class":244},"Milliseconds $ThrottleMs\n",[238,1570,1572],{"class":240,"line":1571},98,[238,1573,544],{"class":244},[238,1575,1577],{"class":240,"line":1576},99,[238,1578,799],{"emptyLinePlaceholder":798},[238,1580,1582,1584,1586,1588,1590],{"class":240,"line":1581},100,[238,1583,482],{"class":244},[238,1585,485],{"class":251},[238,1587,488],{"class":244},[238,1589,491],{"class":251},[238,1591,494],{"class":244},[238,1593,1595,1598,1600],{"class":240,"line":1594},101,[238,1596,1597],{"class":244},"        DeviceName       ",[238,1599,400],{"class":251},[238,1601,1602],{"class":244}," $device.DeviceName\n",[238,1604,1606,1609,1611],{"class":240,"line":1605},102,[238,1607,1608],{"class":244},"        DeviceId         ",[238,1610,400],{"class":251},[238,1612,1613],{"class":244}," $device.Id\n",[238,1615,1617,1620,1622],{"class":240,"line":1616},103,[238,1618,1619],{"class":244},"        ComplianceState  ",[238,1621,400],{"class":251},[238,1623,1624],{"class":244}," $device.ComplianceState\n",[238,1626,1628,1631,1633],{"class":240,"line":1627},104,[238,1629,1630],{"class":244},"        LastSyncDateTime ",[238,1632,400],{"class":251},[238,1634,1635],{"class":244}," $device.LastSyncDateTime\n",[238,1637,1639,1642,1644],{"class":240,"line":1638},105,[238,1640,1641],{"class":244},"        Status           ",[238,1643,400],{"class":251},[238,1645,1646],{"class":244}," $status\n",[238,1648,1650,1653,1655],{"class":240,"line":1649},106,[238,1651,1652],{"class":244},"        Error            ",[238,1654,400],{"class":251},[238,1656,1657],{"class":244}," $errorMessage\n",[238,1659,1661],{"class":240,"line":1660},107,[238,1662,544],{"class":244},[238,1664,1666],{"class":240,"line":1665},108,[238,1667,550],{"class":244},[238,1669,1671],{"class":240,"line":1670},109,[238,1672,799],{"emptyLinePlaceholder":798},[238,1674,1676,1678,1680,1683,1685,1688,1690,1693,1695],{"class":240,"line":1675},110,[238,1677,1281],{"class":244},[238,1679,340],{"class":251},[238,1681,1682],{"class":247}," Export-Csv",[238,1684,252],{"class":251},[238,1686,1687],{"class":244},"Path $ReportPath ",[238,1689,286],{"class":251},[238,1691,1692],{"class":244},"NoTypeInformation ",[238,1694,286],{"class":251},[238,1696,1697],{"class":244},"Encoding utf8\n",[238,1699,1701],{"class":240,"line":1700},111,[238,1702,799],{"emptyLinePlaceholder":798},[238,1704,1706,1709,1711,1713,1716,1718,1720,1722,1724,1726,1728,1730],{"class":240,"line":1705},112,[238,1707,1708],{"class":244},"$failed ",[238,1710,400],{"class":251},[238,1712,1124],{"class":251},[238,1714,1715],{"class":244},"($results ",[238,1717,340],{"class":251},[238,1719,343],{"class":247},[238,1721,346],{"class":244},[238,1723,349],{"class":247},[238,1725,352],{"class":244},[238,1727,355],{"class":251},[238,1729,358],{"class":277},[238,1731,1234],{"class":244},[238,1733,1735,1737,1740,1742,1744,1746,1748,1751,1754,1757,1759,1761,1764,1766,1769,1772],{"class":240,"line":1734},113,[238,1736,1072],{"class":247},[238,1738,1739],{"class":277}," \"Sync requested for ",[238,1741,985],{"class":251},[238,1743,811],{"class":277},[238,1745,491],{"class":251},[238,1747,811],{"class":277},[238,1749,1750],{"class":244},"$results",[238,1752,1753],{"class":277},").Count)",[238,1755,1756],{"class":277}," device(s), ",[238,1758,985],{"class":251},[238,1760,811],{"class":277},[238,1762,1763],{"class":244},"$failed.Count",[238,1765,1001],{"class":277},[238,1767,1768],{"class":277}," failed. Report: ",[238,1770,1771],{"class":244},"$ReportPath",[238,1773,1774],{"class":277},"\"\n",[33,1776,1778],{"id":1777},"notes","Notes",[38,1780,1781,1784,1798,1822,1831],{},[41,1782,1783],{},"A sync makes the device check in now, and compliance is evaluated at check-in. It doesn't change a device's compliance state by itself: a device that genuinely fails a policy still shows non-compliant after the sync, just sooner than it otherwise would.",[41,1785,1786,1787,1789,1790,1793,1794,1797],{},"A successful call only means Intune accepted the request (",[20,1788,22],{}," returns ",[20,1791,1792],{},"204 No Content","). Whether the device checked in shows up later in ",[20,1795,1796],{},"lastSyncDateTime",", which is why the Usage section compares before and after.",[41,1799,1800,1801,1803,1804,1806,1807,1810,1811,1813,1814,1817,1818,1821],{},"Throttling: ",[20,1802,22],{}," is a write against the Intune devices service, which Microsoft documents at 200 POST\u002FPUT\u002FPATCH\u002FDELETE requests per 20 seconds per app per tenant and 400 per tenant across all apps. The default 500 ms spacing works out to 40 calls per 20 seconds, well under that, and leaves room for other tools calling Graph at the same time. If the report shows throttling errors, raise ",[20,1805,195],{}," before assuming anything is wrong with those devices. The script's own single 429 retry is only a backstop: the Graph PowerShell SDK already retries throttled requests itself, honoring ",[20,1808,1809],{},"Retry-After"," (Microsoft: the SDKs \"already implement handlers that rely on the ",[20,1812,1809],{}," header or default to an exponential backoff retry policy\"), up to ",[20,1815,1816],{},"MaxRetry"," times, 3 by default, which ",[20,1819,1820],{},"Set-MgRequestContext"," can change. A 429 only reaches the script once those retries are used up.",[41,1823,1824,1827,1828,1830],{},[20,1825,1826],{},"-Property"," keeps the device query small. ",[20,1829,84],{}," otherwise returns every property of every device, which gets slow on a large tenant.",[41,1832,1833],{},"This is for enrolled devices that still communicate. A device that hasn't checked in for weeks needs a different conversation than a resync: look at its last check-in date and your device cleanup rules first.",[33,1835,1837],{"id":1836},"source","Source",[38,1839,1840,1849,1859,1866,1873,1880],{},[41,1841,1842],{},[1843,1844,1848],"a",{"href":1845,"rel":1846},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fgraph\u002Fapi\u002Fintune-devices-manageddevice-syncdevice?view=graph-rest-1.0",[1847],"nofollow","syncDevice action, Graph v1.0",[41,1850,1851,49,1855],{},[1843,1852,30],{"href":1853,"rel":1854},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fpowershell\u002Fmodule\u002Fmicrosoft.graph.devicemanagement\u002Fsync-mgdevicemanagementmanageddevice?view=graph-powershell-1.0",[1847],[1843,1856,84],{"href":1857,"rel":1858},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fpowershell\u002Fmodule\u002Fmicrosoft.graph.devicemanagement\u002Fget-mgdevicemanagementmanageddevice?view=graph-powershell-1.0",[1847],[41,1860,1861],{},[1843,1862,1865],{"href":1863,"rel":1864},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fintune\u002Fdevice-management\u002Factions\u002Fsync",[1847],"Device action: Sync",[41,1867,1868],{},[1843,1869,1872],{"href":1870,"rel":1871},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fintune\u002Fdevice-configuration\u002Ftroubleshoot-device-profiles",[1847],"Common questions about device policies and profiles (check-in intervals)",[41,1874,1875],{},[1843,1876,1879],{"href":1877,"rel":1878},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fgraph\u002Fthrottling-limits",[1847],"Microsoft Graph throttling limits (Intune)",[41,1881,1882,49,1887],{},[1843,1883,1886],{"href":1884,"rel":1885},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fgraph\u002Fthrottling",[1847],"Microsoft Graph throttling guidance",[1843,1888,1820],{"href":1889,"rel":1890},"https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fpowershell\u002Fmodule\u002Fmicrosoft.graph.authentication\u002Fset-mgrequestcontext?view=graph-powershell-1.0",[1847],[1892,1893,1894],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":234,"searchDepth":440,"depth":440,"links":1896},[1897,1898,1899,1900,1901,1902],{"id":35,"depth":440,"text":36},{"id":97,"depth":440,"text":98},{"id":223,"depth":440,"text":224},{"id":553,"depth":440,"text":554},{"id":1777,"depth":440,"text":1778},{"id":1836,"depth":440,"text":1837},"techcolumnist",[1905,1906],"ps","scripts","2025-10-22T14:00:00Z","A Microsoft Graph PowerShell script that sends the syncDevice action to every matching Intune-managed device, throttled, so compliance is re-evaluated at once.","md",false,null,{},"\u002Fblog\u002F2025\u002F10\u002F22\u002Fpowershell-intune-force-a-compliance-policy-re-evaluation-fleet-wide",{"title":6,"description":1908},[1903],"blog\u002F2025\u002F10\u002F22\u002Fpowershell-intune-force-a-compliance-policy-re-evaluation-fleet-wide",[233,1918],"intune","\u002F2025\u002F10\u002F22\u002Fpowershell-intune-force-a-compliance-policy-re-evaluation-fleet-wide\u002F","Vg7Q3m9RBT0W7GPQrURXWDzxthURKYUfKXMcZFsCGBg",{"title":1922,"description":1923,"date":1924,"url":1925,"categories":1926,"tags":1927,"image":1911,"readingTime":497,"canonical":1903,"sites":1931,"series":1911,"seriesOrder":1911},"PowerShell: Windows 11 – Strip Preinstalled Apps from an Image","A PowerShell script that removes provisioned apps from a mounted Windows 11 WIM or a running system, plus the Windows 11 24H2+ policy that does it natively.","2025-11-05T14:00:00Z","\u002F2025\u002F11\u002F05\u002Fpowershell-windows-11-strip-preinstalled-apps-from-a-deployment-image\u002F",[1905,1906],[233,1928,1929,1930,1918],"windows-11","debloat","gpo",[1903],{"title":1933,"description":1934,"date":1935,"url":1936,"categories":1937,"tags":1938,"image":1911,"readingTime":479,"canonical":1903,"sites":1941,"series":1911,"seriesOrder":1911},"PowerShell: Hyper-V – Automate VM Checkpoints Before Patch Tuesday","A script that takes dated production checkpoints of running Hyper-V VMs on hosts or a whole cluster before patching, prunes its own old ones and plugs into CAU.","2025-10-15T14:00:00Z","\u002F2025\u002F10\u002F15\u002Fpowershell-hyper-v-automate-vm-checkpoints-before-patch-tuesday\u002F",[1905,1906],[233,1939,1940],"hyper-v","cluster",[1903],[1921,1943,1952],{"title":1944,"description":1945,"date":1946,"url":1947,"categories":1948,"tags":1949,"image":1911,"readingTime":508,"canonical":1903,"sites":1951,"series":1911,"seriesOrder":1911},"PowerShell: Intune – Remediation Script for Stuck BitLocker Encryption","An Intune Remediations detect and remediate pair that finds paused, suspended or stalled BitLocker encryption on Windows and fixes the cases that have a documented fix.","2025-09-10T14:00:00Z","\u002F2025\u002F09\u002F10\u002Fpowershell-intune-remediation-script-for-stuck-bitlocker-encryption\u002F",[1905,1906],[233,1918,1950],"windows",[1903],{"title":1953,"description":1954,"date":1955,"url":1956,"categories":1957,"tags":1958,"image":1911,"readingTime":455,"canonical":1903,"sites":1960,"series":1911,"seriesOrder":1911},"PowerShell: Intune – Bulk Assign App Protection Policies by Group","A Microsoft Graph PowerShell script that adds Entra ID groups to an Intune App Protection Policy through the v1.0 assign action without dropping existing assignments.","2025-04-17T14:00:00Z","\u002F2025\u002F04\u002F17\u002Fpowershell-intune-bulk-assign-app-protection-policies-by-group\u002F",[1905,1906],[233,1918,1959],"entra-id",[1903],{"doc":1911,"posts":1962},[],1790052513209]