[OpsMgr] Compare Management Packs Across Management Groups

Published Thursday, December 10, 2009 10:10 PM

The following query will give you the version of each management pack on multiple management groups. Replace MG1 and MG2 with your management group names. This is only useful if you have multiple management groups reporting to the same data warehouse.

With MPs(MG, MP, Version)
AS (
SELECT     vManagementGroup.ManagementGroupDefaultName, vManagementPack.ManagementPackDefaultName, vManagementPackVersion.ManagementPackVersion
FROM         vManagementGroupManagementPackVersion INNER JOIN
                      vManagementGroup ON vManagementGroupManagementPackVersion.ManagementGroupRowId = vManagementGroup.ManagementGroupRowId INNER JOIN
                      vManagementPackVersion ON
                      vManagementGroupManagementPackVersion.ManagementPackVersionRowId = vManagementPackVersion.ManagementPackVersionRowId INNER JOIN
                      vManagementPack ON vManagementPackVersion.ManagementPackRowId = vManagementPack.ManagementPackRowId
)
Select MP, MG1, MG2
from MPs
Pivot (
      max(Version)
      FOR MG in ([MG1], [MG2])) as pvt

Sample Output:

MP MG1 MG2
Windows Cluster Library 6.1.7221.0 6.0.6278.0
Windows Core Library 6.1.7221.0 6.0.6278.0
Windows Server 2000 Operating System 6.0.6667.0 6.0.6321.5
Windows Server 2003 Operating System 6.0.6667.0 6.0.6321.5
Windows Server 2008 Internet Information Services 7.0 NULL 6.0.6539.0
Windows Server 2008 Operating System (Discovery) 6.0.6667.0 6.0.6321.5
Windows Server 2008 Operating System (Monitoring) 6.0.6667.0 6.0.6321.5
Windows Server Internet Information Services 2000 NULL 6.0.6539.0
Windows Server Internet Information Services 2003 NULL 6.0.6539.0
Windows Server Internet Information Services Library NULL 6.0.6539.0
Windows Server Operating System Library 6.0.6667.0 6.0.6321.5
Windows Service Library 6.1.7221.0 6.0.6278.0
WS-Management Library 6.1.7221.0 6.0.6278.0
Filed under:

Comments

No Comments