SCCM – Computers with Pending Restart

Sometimes after patching a machine, you should restart the machine in order to apply the patch. You can create a query-based collection of machines with pending reboot in System Center Configuration Manager. Copy and paste the following query:

SELECT SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client FROM sms_r_system inner join SMS_UpdateComplianceStatus
ON SMS_UpdateComplianceStatus.machineid=sms_r_system.resourceid
WHERE SMS_UpdateComplianceStatus.LastEnforcementMessageID = 9
There are several other enforcement states you can use at the end of the query:
  • 1 – Enforcement started
  • 3 – Waiting for another installation to complete
  • 6 – General failure
  • 8 – Installing update
  • 9 – Pending system restart
  • 10 – Successfully installed update
  • 11 – Failed to install update
  • 12 – Downloading update
  • 13 – Downloaded update

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 282 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.