SCOM Management Pack backup
Ever wish you had a backup of your MP?
It's quite
Tailor to your requirements, but you can run this as a scheduled task, Orchestrator job, etc.
I would recommend running the script on a server with the Operations Manager shell (or at least add the Operations Manager snapIn to a non SCOM server)
NOTE This will unseal sealed management packs
# Backup Management packs to C drive
# Set up your path, my example is monadmin\backup
$date = Get-Date -UFormat "%Y-%m-%d"
c:
cd monadmin\backup
new-item -itemtype directory -path c:\monadmin\backup\$date
cd $date
# Variants accepted
# Examples - begins with OR, or Company Name, or contains Lab
Get-SCOMManagementPack -Name OR* | Export-SCOMManagementPack -Path "C:\monadmin\backup\$date"
Get-SCOMManagementPack -Name <CompanyName>* | Export-SCOMManagementPack -Path "C:\monadmin\backup\$date"
Get-SCOMManagementPack -Name *Lab* | Export-SCOMManagementPack -Path "C:\monadmin\backup\$date"
# Backup Management packs to E drive
# Set up your path, this example is monadmin\backup
$date = Get-Date -UFormat "%Y-%m-%d"
E:
cd monadmin\backup
new-item -itemtype directory -path e:\monadmin\backup\$date
cd $date
Get-SCOMManagementPack -Name OR* | Export-SCOMManagementPack -Path "E:\monadmin\backup\$date"
Get-SCOMManagementPack -Name *Lab* | Export-SCOMManagementPack -Path "E:\monadmin\backup\$date"