Hi,
Just to save for myself too. I was playing with XML support in PowerShell and was able to use the following to delete part of the XML. This is very useful, especialy for dealing with Operations Manager Default User Management Pack. You can select data for a specific Management Pack and delete it, so that the desired Management pack can be removed without deleting the Default User MP.
To save the update MP, use Save method:
Just to save for myself too. I was playing with XML support in PowerShell and was able to use the following to delete part of the XML. This is very useful, especialy for dealing with Operations Manager Default User Management Pack. You can select data for a specific Management Pack and delete it, so that the desired Management pack can be removed without deleting the Default User MP.
$xml = [xml](Get-Content ".\Microsoft.SystemCenter.OperationsManager.DefaultUser.xml")You can also export these contents before deleting. Like that
$xml.ManagementPack.Monitoring.Overrides.MonitorPropertyOverride | ? {$_.Monitor -like "*Exchange*" -or $_.Context -like "*Exchange*"} | % {$_.ParentNode.RemoveChild($_)}
$xml.ManagementPack.Monitoring.Overrides.MonitorPropertyOverride | ? {$_.Monitor -like "*Exchange*" -or $_.Context -like "*Exchange*"} | % {$_.OuterXML} | Out-File .\MPO.xml
To save the update MP, use Save method:
$xml.Save("FullPath")
Комментариев нет:
Отправить комментарий