As you know, best practices is to create one override MP by MP you want to tune. One of the tasks we wanted to do is to ensure that all overrides stored in unsealed MPs are corresponding to the sealed assocaited MP.
Listing all references of unsealed MPs is a good help to identify what unsealed MP has a reference on a MP (and also override) that should not be referenced !
Download the file :
Or create a file : ListReferenceUnsealedMPs.ps1
- param([string]$Path)
- $Exportfile = [string]$Path + "\ListAllReferencesForNonSealedMPs.csv"
- $Exportfile
- # SCOM 2007R2
- $mps = get-managementpack | where-object {$_.Sealed -eq $false}
- # SCOM 2012
- # $mps = Get-SCOMManagementPack | where-object {$_.Sealed -eq $false}
- "Management Pack Name;Reference Name;Reference Key Token;Reference Version;Reference ID;Reference Version ID" >> $Exportfile
- Foreach ($mp in $mps)
- {
- $References = $mp.References
- foreach ($Ref in $References)
- {
- $mp.Name + ";" + $Ref.name + ";" + $Ref.KeyToken + ";" + $Ref.Version + ";" + $Ref.Id + ";" + $Ref.VersionId >> $Exportfile
- }
- }
This will create a c:\Temp\ListAllReferencesForNonSealedMPs.csv that contains all References by unsealed MP.
Openning the .csv file with excel will give you :
Enjoy !
This posting is provided "AS IS" with no warranties.
No comments:
Post a Comment