Pages

Thursday, December 2, 2010

How to backup Active Directory for recovery on Windows Server 2008

How to backup Active Directory for recovery on Windows Server 2008

Operating system : - Windows Server 2008 

You need need to maintain a good backup for system state of your active directory, First make a System State backup on a Domain Controller and maintain those backups by removing the old ones from the backup catalog.

Requirement:

1.       A secondary hard disk on domain controller attached locally to it. A network drive won't work.
2.       Install the Windows server backup (Backup tool is not installed by default)

To  Install it:

1.       Open Window Server manager snap-in
2.        Access features section and click on Add a New feature
3.       Select Windows Server backup  including the “Command Line tools”, This will also require PowerShell
4.       Click on Install button.

Scheduling the System State Backup

If you check the GUI of the Windows SerVer Backup, You will find there is no method available to backup the System state. The only possible way to backup the System state using this tool is using the command line.  Now to run  the backup as schedule task we need to make a script file (.bat) will schedule it.

Here we go

1.       In Notepad or any other  text editor
@echo off
### “off” will not display processing on the screen
WBADMIN START SYSTEMSTATEBACKUP –backuptarget:d: -quiet
###”d: ” is your  drive where backup of catalog will be saved
###”-quiet”: is the parameter used to not to ask for any confirmation

2.       Save it as a batch file naming “PCS-SysStateBKP.bat” and save it to D: drive

3.       Run -> Tasks -> New Task -> On General tab
a.       Run whether the user is logged or not
b.       Run with the highest privileges

4.       Triggers Tab , click ‘New’ define schedule you want
5.       On Actions click on the “New” and select a Start a program, map it to d:\ “PCS-SysStateBKP.bat”
6.       Ok, Run


This schedule task will take 1 hr approximately.  Till the time Task will show “This process is running”. Please make sure your D:\ drive have enough free space as equal to your ‘System’ drive which is commonly C drive. This automatic backup will save the file as .bkf which you can’t view.

We can write a new schedule task that will keep every week only the newer backups:
WBADMIN DELETE SYSTEMSTATEBACKUP – BACKUPTARGET:e: -deleteOldest –quiet

Save this command in notepad as D:\“pcs-OldStateDel.bat”
Now schedule it as a task to run weekly. You may like to run this schedule task before the backup task.

Restore AD:
http://technet.microsoft.com/en-us/library/cc732714(WS.10).aspx


****AS IS**** ; Please apply at your own risk.

No comments:

Post a Comment