SCCM 2007 : Get Service Window with PowerShell / WMI


Just a quick post to show you how to retrieve SCCM Client Service Window directly from a PowerShell script. The script is really simple, it queries the class CCM_ServiceWindow in the namespace "rootCCMpolicymachineactualconfig". This script must be executed directly on a SCCM Client computer.

Script :

$strComputer = ""
$Username = "Administrator"
$Password = "P@$$w0rd"

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
$List = get-wmiobject -class "CCM_ServiceWindow" -namespace "rootCCMpolicymachineactualconfig" -computername $strComputer -Credential $cred

foreach($item in $list)
    Write-Host $item.ServiceWindowID

Output :


Christopher KEYAERT

About Christopher Keyaert

Christopher Keyaert is a Consultant, focused on helping partners to leverage the System Center and Microsoft Azure cloud platform. He is also a Microsoft Most Valuable Professional (MVP) for Cloud and Data Center Management and a Microsoft Certified Trainer (MCT).
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *