Advertisement
Combreal

reset-ccm.ps1

Jun 12th, 2025
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Run as admin to stop the SCClient, reset the Confuguration Manager, refresh the Configuration Manager Policies and restart the SCClient.
  2.  
  3. If (Get-Process -Name "SCClient") {
  4.     Stop-Process -Name "SCClient"
  5. }
  6.  
  7. Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name ResetPolicy 1
  8.  
  9. $IDMappings = @{
  10. 'MachinePolicy'        = '{00000000-0000-0000-0000-000000000021}';
  11. 'DiscoveryData'        = '{00000000-0000-0000-0000-000000000003}';
  12.  #'ComplianceEvaluation' = '{00000000-0000-0000-0000-000000000071}'; #not found
  13. 'AppDeployment'        = '{00000000-0000-0000-0000-000000000121}';
  14. 'HardwareInventory'    = '{00000000-0000-0000-0000-000000000001}';
  15. 'UpdateDeployment'     = '{00000000-0000-0000-0000-000000000108}';
  16. 'UpdateScan'           = '{00000000-0000-0000-0000-000000000113}';
  17. 'SoftwareInventory'    = '{00000000-0000-0000-0000-000000000002}';
  18. }
  19.  
  20. ForEach ($IDMapping in $IDMappings.Keys) {
  21.    Write-Host "${IDMapping}: $($IDMappings.$IDMapping)"
  22.    Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule $($IDMappings.$IDMapping)
  23. }
  24.  
  25. Start-Process -FilePath "C:\Windows\CCM\ClientUX\scclient.exe"
  26.  
Tags: powershell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement