Guess most of you are struggling with troubleshooting software update compliance and installing applications in Configuration Manager 2012. What I have found, is that clients in a reboot pending state often is the root cause to the problems. In previous posts I have described how you can use tools like Coretech Shutdown Utility to automatically restart computers that has been in a reboot pending state for X number of hours/days. 

The information about the reboot pending state is stored in WMI Root\ccm\ClientSDK namespace as illustrated here with the Coretech WMI & PowerShell explorer:

image

Identify reboot state using PowerShell

Launch PowerShell ISE and type Invoke-WmiMethod -Namespace "ROOT\ccm\ClientSDK" -Class CCM_ClientUtilities -Name DetermineIfRebootPending

image

image

Notice RebootPending is True in the first example and False in the second example. Now let’s take the PowerShell command and turn it into a Compliance rule in Configuration Manager 2012.

Create the Compliance rule in Configuration Manager

  1. Launch the Configuration Manager console, navigate to the Assetts and Compliance workspace, Compliance Settings, Configuration Items.
  2. Create a new Configuration Item, Select Windows and click Next.

    image

  3. Select all Operating systems, and click Next.
  4. On Settings, click New. In Setting type, select Script and in Data select Boolean.

    image

  5. On Discovery Script, click Add Script and type
  6. Invoke-WmiMethod -Namespace "ROOT\ccm\ClientSDK" -Class CCM_ClientUtilities -Name DetermineIfRebootPending  | select-object -ExpandProperty "RebootPending" and click OK.

    image

  7. Select the Compliance Rule tab, and click New. Configure the following values to False and click OK.

    image

  8. Finish the wizard. Notice that I’m not creating a remediation script as I do not want to force a reboot.
  9. Create a new Baseline, and add the Reboot Pending Configuration Item.

    image

  10. Deploy the baseline to a device collection.
  11. Right click the baseline deployment, select Create New Collection, Non-compliant.

    image