Welcome to MSDN Blogs Sign in | Join | Help

MP Backup

Here is a script that I wrote last night to demonstrate how you can implement a simple MP backup process. The goal is to allow you to backup unsealed MPs so that if you make a mistake you can go back to the good copy. You can also schedule this script to run on a daily basis using Task Scheduler.

Here is how you can run the script from the command line:

powershell.exe C:\BackupMPs.ps1 -rmsName:'rms.contoso.com' -folderName:'c:\Backups'

Published Wednesday, April 30, 2008 11:05 PM by Boris Yanushpolsky

Attachment(s): BackupMPs.ps1

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: MP Backup

Wednesday, May 07, 2008 3:54 PM by Sven Wells

Hi,

Great script, but I have one issue.  It seems if I try to run it on a computer other than the actual RMS, it fails with the message:

Add-PSSnapin : No Windows PowerShell Snap-ins are available for version 1.

At D:\BackupMPs.ps1:10 char:13

+ add-pssnapin  <<<< "Microsoft.EnterpriseManagement.OperationsManager.Clie

Set-Location : Cannot find a provider with name 'OperationsManagerMonitorin

At D:\BackupMPs.ps1:11 char:13

+ Set-Location  <<<< "OperationsManagerMonitoring::";

The term 'New-ManagementGroupConnection' is not recognized as a cmdlet, fun

n, operable program, or script file. Verify the term and try again.

At D:\BackupMPs.ps1:12 char:40

+ $mgConn = New-ManagementGroupConnection  <<<< -connectionString:$rmsName;

The non-RMS server I am trying this on is the Datawarehouse server, which has the capacity to hold all my backup files, ie. sql db backups.

Any ideas?

Thanks,

Sven

# re: MP Backup

Wednesday, June 04, 2008 4:53 PM by Boris Yanushpolsky

The script is written such that it will run on computers other than the RMS. However, the computer on which you are running the script needs to have the Console and the OpsMgr Command Shell installed.

# A Great place for SCOM scripts

Sunday, July 13, 2008 7:12 AM by Dario IT Solutions Blog

Check out Boris Yanushpolsky&#39;s blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM

# re: MP Backup

Tuesday, February 17, 2009 2:46 PM by billmc@microsoft.com

To automate via sheduled tasks

here is how below

1. Start powershell command prompt

2. Set-executionpolicy remotesigned

3. Use get-executionpolicy to check

4. Copy the backupmps.ps1 script to a directory on the server. I used c:\backupmps

5. Create a scheduled task to start powershell

for example

Command line   is C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe c:\backupmps\backupmps.ps1 -rmsname:'billmcdell' -foldername:'c:\backupmps'

Start directory in is the same c:\windows\system32\windowspowershell\1.0\

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker