REBOOT PENDING (SMS_UpdateComplianceStatus.LastEn forcementMessageID = 9)

I am trying to create a collection/query in which I would detect the devices which have a pending reboot. I am using the following code obtained from the internet.

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

It seems to work, but....I also noticed some clients which do not have a reboot pending and still have in SCCM the LastEnforcementMessageID set to 9.

Does someone have the same behavior and knows how to fix this ?

Also I see in my query that this specific client reports LastEnforcementMessageID <null>, 9 and 10 at the same time.

January 29th, 2015 4:01pm

they might actually require a reboot. some updates require more then one reboot.
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2015 4:31pm

Check out Kent's solution

http://blogs.msdn.com/b/steverac/archive/2014/06/12/automating-software-updates.aspx

January 31st, 2015 5:34am

you should try this to get computers pending reboot using configuration baselines http://blogs.technet.com/b/smartinez/archive/2014/06/27/reboot-pending-report-how-to-create-the-report.aspx
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 6:16am

Thanks Eswar ... i test that solution and that worked fine.

My issie was that the script uses the Powershell command Test-Path which not always seems to work.

After chaging that it worked fine.

February 4th, 2015 5:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics