Home » System Center Data Protection Manager » Using Pre-Backup and Post-Backup Scripts in DPM


Welcome to contoso.se! My name is Anders Bengtsson and this is my blog about Azure infrastructure and system management. I am a senior engineer in the FastTrack for Azure team, part of Azure Engineering, at Microsoft.  Contoso.se has two main purposes, first as a platform to share information with the community and the second as a notebook for myself.

Everything you read here is my own personal opinion and any code is provided "AS-IS" with no warranties.

Anders Bengtsson

MVP awarded 2007,2008,2009,2010

My Books
Service Manager Unleashed
Service Manager Unleashed
Orchestrator Unleashed
Orchestrator 2012 Unleashed
Inside the Microsoft Operations Management Suite

Using Pre-Backup and Post-Backup Scripts in DPM

You can configure DPM to run scripts before (pre) and after (post) each DPM backup job. This can used to prepare the data source for backup and also to start a service again after backup. 

On each agent machine, in the DPM folder under \DPM\Scripting there is a file named ScriptingConfig.xml. This is the file that you use to configure pre-backup scripts and post-backup scripts. These scripts are run with the local system account. The script needs to be configured on each agent, or you could use some find of deployment system to deploy the configuration file to multiple machines.

In my test I simply stopped the print spooler (spooler) service and started it again after backup. I created two CMD files in C:\Scripts. The files include “net start spooler” and “net stop spooler”. My test machine ScriptConfig.xml looks like this (click to view the full image):

The BackupCommandLine lines is for command-line parameters to be passed to the script. The DataSourceName attribute is the data source volume or name, for example a storage group name in Exchange.

I have not found a good way to see if the pre-backup and post-backup script ran successfully. But if you have Operations Manager in your environment, you can configure your scripts to echo to event viewer. Then you can use the missing event monitor to make sure the scripts are run successfully every X minute, for example if you do a backup every hour, then you want an event every hour too.

Remember to include your scripts in your disaster recovery plan.


1 Comment

Comments are closed.