Skip to content

Instantly share code, notes, and snippets.

@janegilring
Created June 16, 2013 11:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janegilring/5791780 to your computer and use it in GitHub Desktop.
Save janegilring/5791780 to your computer and use it in GitHub Desktop.
Sample PowerShell functions for working with the ROOT\ccm\ClientSDK WMI namespace. For more info, see the related article on blog.powershell.no.
function Get-CMMissingUpdate {
param (
$computer = "localhost"
)
Get-WmiObject -Query "SELECT * FROM CCM_SoftwareUpdate" -Namespace "ROOT\ccm\ClientSDK" -ComputerName $computer
}
function Install-CMMissingUpdate {
param (
$computer = "localhost"
)
([wmiclass]'ROOT\ccm\ClientSDK:CCM_SoftwareUpdatesManager').InstallUpdates([System.Management.ManagementObject[]] (
Get-WmiObject -Query 'SELECT * FROM CCM_SoftwareUpdate' -namespace 'ROOT\ccm\ClientSDK'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment