Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 807 Bytes
################################################################
# Author: Andreas Sobczyk, CloudMechanic.net
#
# Get Empty classes from Management Packs
################################################################
## Get all management packs starting with Contoso.
$MPs = Get-SCOMManagementPack -name Contoso*
## For each MP, For each Class, count classinstances.
$Overview = @()
Foreach($MP in $MPs){
$Classes = $mp.GetClasses()
foreach($Class in $Classes){
$ClassInstance = $null
$ClassInstance = Get-SCOMClassInstance -Class $class
## If you want you can change the number of class instances to sort on.
if($ClassInstance.Count -le 0){
$Overview += $Class
}
}
}
$Overview | Format-Table Name,Displayname,ManagementPackName