How to use a pre-backup or post-backup script to reset the archive bit in System Center Data Protection Manager

InformationHere’s a good tip you might find handy.  Let’s say you have a situation where you have a legacy application or some other need that requires the archive bit to be reset for data which is being backed up. Given the fact that DPM does not use the Archive bit but instead uses the USN Change journal you will have to accomplish this using a Pre-Backup or Post-Backup script.

In the following example I use a Post-Backup script to set the Archive bit on all the files in C:\DataDirectory recursively after the backup is done:

1. Edit the "%programfiles%\Microsoft Data Protection Manager\DPM\Scripting\ScriptingConfig.xml" to have the following contents on the Protected Server:

<?xml version="1.0" encoding="utf-8"?>
<ScriptConfiguration xmlns:xsi="";
xmlns:xsd=""; xmlns="";>
  <DatasourceScriptConfig DataSourceName="C:\DataDirectory">

2. Create a script in C:\SetAcrhiveBit.cmd locally on the Protected Server to have the following contents:

cd /d C:\DataDirectory
attrib  /S  +A      *

That’s it!

Please note that the "DataSourceName" attribute in the ScriptingConfig.xml must match the name of the datasource as displayed in the DPM Administrative Console. In addition, if you have multiple datasources on a protected server which require a Pre/Post backup script then you must make additional entries in the ScriptingConfig.xml file using the XML blob as shown above with spaces between each and pay careful attention to specify the correct name for the datasource in the "DataSourceName" attribute as well as the "PostBackupScript" or "PreBackupScript" attribute to point to the correct location of the script which needs to be executed.

Note: This applies to DPM 2007 as well as DPM 2010.

For more information about how to use pre-post scripts for different data-sources please see the following TechNet documentation:

Tyler Franke | Senior Support Escalation Engineer

The App-V Team blog:
The WSUS Support Team blog:
The SCMDM Support Team blog:
The ConfigMgr Support Team blog:
The OpsMgr Support Team blog:
The SCVMM Team blog:
The MED-V Team blog:
The DPM Team blog:
The OOB Support Team blog:
The Opalis Team blog:

clip_image001 clip_image002