PowerShell script to backup unsealed SCOM MPs
Not sure if anyone has written this before. I have written this simple script to backup all unsealed management packs.
I have scheduled it to run daily on RMS via Windows Task Scheduler.
How does it work:
- Backup unsealed MPs to a local folder.
- Delete older backups from local folder
- robocopy backup from local folder to a remote location using purge option (Anything that not exist from source will be deleted from destination. Therefore old backups are deleted from remote folder as well.)
Preparing the script:
Modify line 21-23 to suit your environment
$backuproot – local folder where MPs are backed up to.
$remoteLocation – Remote location where backups are robocopied to.
$daysToKeep – retention period
Finally, make sure you the account scheduled task runs under has appropriate rights in SCOM.
Download the script HERE.
Leave a comment