Directory Services |
[This documentation is preliminary and subject to change.]
To back up an ADAM instance, use the Backup Utility for Windows. You can automatically perform a backup by entering a command for ntbackup.exe at a command prompt or by running the backup from a script.
To run the Backup Utility, you specify a command that requires the following form:
ntbackup backup InstancePath /snap:on /d Description /n Name /m normal /l:f /f BackupPath
In the preceding command:
Note When you install ADAM, you must specify the same folder for both types of files to use this backup method.
You can restore the backup of the instance you make with the following code example by Restoring an ADAM Instance.
The following VBScript code example constructs a command line to run the ntbackup.exe utility to back up a selected instance.
' Backup ADAM Instance. Option Explicit Const conWindowStyle = 1 Const conWaitOnReturn = True Dim intResult ' Result of command execution. Dim objShell ' Command shell object. Dim strADAMInstanceName ' Name of instance to back up. Dim strADAMInstancePath ' Path of instance to back up. Dim strBackupPath ' Path of backup file. Dim strCommandLine ' Backup command line. Dim strDescription ' Description of backup. ' Specify a name for the instance. ' Change "instance1" to name of selected instance. strADAMInstanceName = "instance1" ' Specify path for ADAM instance. ' Change "C:\Program Files\Microsoft\ADAM\instance1\data" ' to the path of the data files for the ADAM instance to back up. strADAMInstancePath = _ "C:\Program Files\Microsoft\ADAM\instance1\data" ' Specify path for backup file. ' Change "C:\Temp\" to the path to store backup file. strBackupPath = "C:\Temp\" & strADAMInstanceName & ".bkf" ' Specify description of backup. strDescription = "Backup of ADAM instance: " & strADAMInstanceName strCommandLine = _ "cmd /c ""ntbackup backup """ & strADAMInstancePath & _ """ /snap:on /d """ & strDescription & _ """ /n ""ADAM Backup"" /m normal /l:f /f """ & _ strBackupPath & """""" WScript.Echo "Execute: " & vbNewLine & strCommandLine Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run strCommandLine, conWindowStyle, conWaitOnReturn WScript.Echo WScript.Echo "To restore this backup:" WScript.Echo " 1. Use the Services Administrative Tool" WScript.Echo " to stop the service for the ADAM instance." WScript.Echo " 2. At a command prompt, type ""ntbackup.exe""." WScript.Echo " 3. If NTBackup starts in Wizard mode," WScript.Echo " click Advanced Mode." WScript.Echo " 4. In Advanced Mode," WScript.Echo " click the Restore and Manage Media tab." WScript.Echo " 5. Select the backup file to restore" WScript.Echo " by clicking its check box." WScript.Echo " 6. To start the restore," WScript.Echo " click the Start Restore button." WScript.Echo " 7. Click OK in the Confirm Restore dialog." WScript.Echo " 8. When the restore is done," WScript.Echo " click Close in the Restore Progress dialog." WScript.Echo " 9. To exit NTBackup, select Exit from the Job menu." WScript.Echo " 10. Use the Services Administrative Tool" WScript.Echo " to restart the service for the ADAM instance." WScript.Echo