Automating the System Center Configuration Manager 2012 client

When working with the Server Core installation of Windows Server, most GUI applications does not work. This is expected for the most GUI applications, since dependencies for those GUIs is not present on Server Core. One such example is Software Center, which is part of the System Center 2012 Configuration Manager client.

When trying to launch Software Center (C:\Windows\CCM\SCClient.exe) on Server Core you  might get an error such as “SCClient has stopped working”:


For the most part you wont have the need to launch the Software Center on a Server Core installation of Windows Server. I recently worked with software updates on Windows Server 2008 R2 Hyper-V with Server Core. Although the WSUS integration in System Center Virtual Machine Manager might be a better option for working with Windows Updates on Hyper-V, System Center Configuration Manager 2012 was used in this particular scenario. As Hyper-V servers need to be in maintenance mode before maintenance work such as Windows patching, triggering the installation of new software updates in the SCCM Client needed to be performed manually in the scenario I worked with.

The first thing I tried was the UDA.CCMUpdatesDeployment COM object, which Boe Prox has written an excellent article about. However, this COM object is part of the System Center Configuration Manager 2007 client, and not available in the System Center Configuration Manager 2012 client.

It turns out there is a new WMI namespace in System Center Configuration Manager 2012, the ROOT\ccm\ClientSDK, which provides similar capabilities. If you have not worked a lot with WMI before, exploring this namespace might be a challenge. There is a project on CodePlex to make this a bit easier, the Client Center for Configuration Manager project:


This is a WPF GUI application for working with the ROOT\ccm\ClientSDK remotely, using WinRM. A nice feature of the GUI, is that the underlying PowerShell commands is shown at the bottom:


When clicking on “Missing Updates”, the PowerShell command actually running on the remote computer is Get-WmiObject -Query “SELECT * FROM CCM_SoftwareUpdate” -Namespace “ROOT\ccm\ClientSDK”.

When you click Install all, you will see that the InstallUpdates method is used to trigger installation of missing updates:


Based on this information, we can create PowerShell functions to make it easier to work with these commands. This is a few basic examples:

These functions can be used on computers with the System Center Configuration Manager 2012 client installed:


Ideas for further work:

  • Use the CIM cmdlets available in PowerShell 3.0 and above to create functions that will work with either DCOM (legacy WMI) or WSMan (PowerShell Remoting). You can find excellent examples in some of the 2013 Scripting Games entries. One example is the Get-SystemInventory function from Event 2.
  • Use PowerShell or the Configuration Manager Trace Log Tool to track installation status from SCCM log files such as C:\Windows\CCM\Logs\WUAHandler.log:


  • Use the Get-PendingReboot function to track whether a reboot is required after installing updates:


System Center Virtual Machine Manager vCheck

System Center Center Virtual Machine Manager (SC VMM) is part of the Microsoft System Center family, used to manage virtual infrastructures. The 2008 R2 version supports managing both Microsoft Hyper-V and VMware (communicating via VMware vCenter), while the 2012 version which was released in April 2012 added support for Citrix XenServer. Among the added benefits of using SC VMM for managing your hypervisor infrastructure is capabilities such as Physical to Virtual (P2V) conversion, creating virtual machines based on templates as well as having a centralized console for management. The 2012 release also added capabilities for managing private cloud infrastructures, where the managed hypervisors will be abstracted under the new Fabric bar:


There are many additional changes in the 2012 release, including the ability to manage services, storage, networking, cluster creation and many more. If you are interested in learning more I would recommend you to watch the TechNet Edge video Virtual Machine Manager 2012: Technical Overview as well as dig into the product documentation (link in the Resource section below).

Most, if not all, Hyper-V production environments I have worked with use SC VMM for management. One thing that many administrators may miss however, is a quick glance at the status of the environment. You do of course see the status of the hosts and virtual machines by opening the console, but other things such as old checkpoints and the use of dynamic virtual hard disks instead of Fixed size virtual hard disks is not easily discoverable. Since SC VMM is based on Windows PowerShell (for example, you get a “View Script” button showing the complete PowerShell code when creating a new virtual machine), gathering this information and presenting it in a report is not so difficult. Let me introduce the SC VMM vCheck:


SC VMM vCheck

If you work with both PowerShell and VMware, there is a good chance you have seen and used Alan Renoufs very useful vCheck script:

vCheck is a vCenter checking script, the script is designed to run as a scheduled task before you get into the office to present you with key information via an email directly to your inbox in a nice easily readable format.

For more information and detailed usage guidance, see this article.

Beginning with the 6.0 release of vCheck, Alan added the support for Plugins, making it easier for the community to contribute with their own checks. I had several snippets of PowerShell code for checking various things such as VMs with snapshots, so when I saw the new Plugins capability added to vCheck I thought it would be a good opportunity to provide a SC VMM Plugin. Here is the initial checks in the SC VMM Plugin for vCheck:

  • SC VMM Connection Plugin
  • General Information
  • SC VMM Basic Host Information
  • Hyper-V Cluster Shared Volumes
  • Hyper-V VMs with snapshots
  • SC VMM New VMs
  • SC VMM VM Operating System Statistics
  • Hyper-V VMs with mounted ISO
  • Hyper-V Legacy VM NIC Adapters
  • Hyper-V VMs with static MAC address
  • SC VMM Dynamically Expanding Disks
  • SC VMM Dynamically Expanding Disks Consolidation Forecast
  • Hyper-V Integration Components Version
  • Hyper-V 2008 R2 SP1 Capacity Report

As you can see I have divided the plugins into two categories, one for SC VMM which works across all supported hypervisors, as well as some specific for Hyper-V.

vCheck contains a ps1-file named GlobalSettings.ps1, where you can specify the name of the SC VMM server, e-mail settings (if you want the report e-mailed to you) as well as HTML color codes. Here you can see two examples of the same report using different colors:

image  image

You can download the plugin from this link:

SC VMM vCheck Plugin Download

If you want to add a new Plugin, all you need to do is to create a ps1-file in the Plugins-folder, preferably in a subfolder. Then you add the following 7 variables at the top of the file, and your code at the bottom. The main script will pick up objects from the Plugins, so make sure you output objects with only the desired properties. For example Get-VM | Select-Object name.

We can look at the VM Operating System Statistics as an example:

This is actually a PowerShell “one-liner” turned into a vCheck Plugin. Note that the $VMs variable contains all virtual machines managed by SC VMM and is created in the SC VMM Connectivity Plugin. The settings section is not used by the above plugin, however, this is a section intended for Plugin specific settings such as the threshold for how old snapshots you want to include in the report.

Over time the SC VMM Plugin will hopefully grow by added community contributions. If you want to contribute, or have suggestions for new Plugins, please add them to the SC VMM Plugin sites comment section, as more people will discover them there compared to this article.

If you want to hear more about the SC VMM vCheck I was interviewed to talk about it on the Get-Scripting podcast, you can download the episode from here.



System Center Virtual Machine Manager 2012 on Microsoft TechNet

System Center Virtual Machine Manager 2008 and 2008 R2 on Microsoft TechNet

Automate a task in System Center Virtual Machine Manager 2012 based on the “View Script” button