If you have Configuration Manager managed client host, there will be ROOT\ccm\Client namespace in WMI. Class SDKCCM_ClientUtilities has a properties with two possible values:
- RebootPending
- IsHardRebootPending
NAMESPACE | CLASS | PROPERTY | VALUE | PRODUCT | NOTES |
---|---|---|---|---|---|
ROOT\ccm\Client | SDKCCM_ClientUtilities | DetermineifRebootPending | RebootPending | SCCM | ReturnValue needs to be 0 and this value is not null |
ROOT\ccm\Client | SDKCCM_ClientUtilities | DetermineifRebootPending | IsHardRebootPending | SCCM | ReturnValue needs to be 0 and this value is not null |
You can use the following PowerShell command to verity the client host needs a reboot or not.
Invoke-WmiMethod -ComputerName localhost -Namespace "ROOT\ccm\ClientSDK" -Class "CCM_ClientUtilities" -Name DetermineIfRebootPending | Select-Object -Property PSComputerName,RebootPending
PSComputerName RebootPending
—————————— ————————-
D00155DD61A6F False
You can also replace localhost with a real computer name to verify a remote host.