02.07.2014 Script update Version3

Add UNC Path Support and also use new CMDLets (Get-SCOMManagementPack, Export-SCOMManagementPack)

05.03.2014 Script update Version2

It's important to have a backup of your Custom Management Packs in your SCOM Enviroment.

There are many Script in the WWW to do this. I've also create a Backup Script for my Needs and I think it's very useful.

What's the requirements?

Some of my Customers want to Backup there unsealed MP's and also want to know, is there an error during the backup.

For this requirements I've created the following script (see on below):

What does the script do?

The script make a Backup from all of your unsealed Management Packs and Check is there an error during the Backup Task. You can also define how long the Backups stay in your Backup Location.

What Variables can be changed?

There are three Variables how can be changed from your self.

  • $eventlog > Defines the Eventlog.
  • $eventlogsource  > Defines the Eventlog Source.
  • $erroreventid       > Defines the Eventlog ID if an error occurs.
  • $successeventid   > Defines the Eventlog ID if everthing is okay

 

image

 

How can I start the Script?

You can Start the Skript with the following Parameters:

Backup.ps1 -rmsName scom2012r2 -folderName "C:\MPBackup\Backups" -maxbackupsave 30

The -rmsName defines the SCOM Server.
The -folderName defines the Backup Location
The -maxbackupsave defines the Days how Long are the Backups stored

How the events look like?

There are two different Events. One success and on error Event.

The Success Event looks like:

 

The Error Event looks like:

 

Here is the script. I tested this script in my Test Environment and everything running fine.

You use this script on your own risk.