Wednesday, May 9, 2012

[OpsMgr 2007] Powershell Script to list patches / CU applied on SCOM Agents

Here is a short powershell script to determine what is the CU level of all your agent. Launch this code in a powershell shell, connected to your management group.


  1. $class = get-monitoringclass -name "Microsoft.SystemCenter.HealthService"
  2. $property = $class.getmonitoringproperties() | ? { $_.Name -eq "PatchList" }
  3. $Result = get-agent | ft -auto Name, @{Label="PatchList"; Expression={$_.hostedhealthservice.getmonitoringpropertyvalue($property)} }


$Result exported in an excel sheet should look like :
 


This could be usefull to follow CU deployment on agents.




This posting is provided "AS IS" with no warranties.

1 comment:

  1. nice script, and nice stash, that thing is straight out of the 70's.

    ReplyDelete