Last active
April 16, 2024 08:18
-
-
Save HighLibrarian/7e8d78a202680e610cb26bd6313d6f7e to your computer and use it in GitHub Desktop.
makes intune devices sync their policies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$GroupId = "bc8b6f66-fd59-412f-9b2e-1a0de52466a5" | |
# Importing the SDK Module | |
Import-Module -Name Microsoft.Graph.DeviceManagement.Actions | |
Connect-MgGraph -scope DeviceManagementManagedDevices.PrivilegedOperations.All, DeviceManagementManagedDevices.ReadWrite.All,DeviceManagementManagedDevices.Read.All | |
#### Gets All devices | |
$Devices = Get-MgGroupMember -GroupId $GroupId | |
Foreach ($Device in $Devices) | |
{ | |
Sync-MgDeviceManagementManagedDevice -ManagedDeviceId $Device | |
Write-Host "Sending Sync request to Device with Device name $Device" -ForegroundColor Yellow | |
} | |
Disconnect-Graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment