Backup of Lightweight Directory Services with NTDSutil and dsdbutil

Taking Active Directory manual backup using NTDSutil and DSDButil is straightforward. First we will see how to take backup of Active directory using NTDSutil.

Backup of Active Directory using NTDSutil:

We will find out how to take backup of active directory database and logs, before taking backup using NTDSutil first you need to stop the Lightweight Directory instance that we have created in previous post Installation of AD LDS. Run the command prompt as administrator and run the following command for stopping the Lightweight Directory instance named “LDS-ins”.

C:UsersAdministrator>net stop LDS-ins

Also I have created a backup folder for backup in my C drive which have following three sub folders.

c:backupdata                                 For LDS data files

c:backupLDSbackup                    For LDS backup

c:backuplogs                                  For LDS logs

Now use the command ntdsutil for open ntdsutil console, and run the command activate instance LDS-ins where LDS-ins is LDS instance. Now type the “file” and press enter and run the command “move db to E:backupdata” to move database to data folder.


C:UsersAdministrator>net stop LDS-ins
C:UsersAdministrator>ntdsutilntdsutil: activate instance LDS-insntdsutil:file

file maintenance: move db to c:backupdata

Backup AD lds NTDSutil.jpg

For saving logs into logs folder run the following command inntdsutil console.


move log to c:backuplog

logs Backup AD lds NTDSutil.

Once the backup is completed run the command

C:UsersAdministrator>net start LDS-ins

Backup of Active Directory using DSDButil:

DSDButil is preferred tool for working with LDS, you can open dsdbutil-tool by running command dsbdutil in command prompt, make sure you run the administrator’s command prompt. And for backup also review the following commands:


C:UsersAdministrator>dsdbutil
 

dsdbutil: activate instance LDS-INS

Active instance set to "LDS-INS".

dsdbutil: ifm

ifm: create full c:backupbackup

Creating snapshot...

Snapshot set {8971ffa5-65b8-45ec-a8fb-074a006b0a7b} generated successfully.

Snapshot {04ffaa5d-1a40-4644-94fb-e9a54c5b7b37} mounted as C:$SNAP_201212182304

_VOLUMEC$

Initiating DEFRAGMENTATION mode...

Source Database: C:$SNAP_201212182304_VOLUMEC$backupdataadamntds.dit

Target Database: c:backupbackupadamntds.dit

 

Defragmentation  Status (% complete)

 

0    10   20   30   40   50   60   70   80   90  100

|----|----|----|----|----|----|----|----|----|----|

...................................................

 

Snapshot {04ffaa5d-1a40-4644-94fb-e9a54c5b7b37} unmounted.

IFM media created successfully in c:backupbackup

 

Restore backup using DSDButil:

Restoring backup from dsdbutil is also simple you need few command to accomplish this task.

Run the command prompt as administrative and run the following command for taking backup active directory w7.com.

dsdbutil

authoritative restore

restore object cn=w7,dc=w7,dc=com

Backup of Active Directory using DSDButil
 

Waqas Azam
Me Waqas Azam and I am a professional blogger & freelance writer. I also working in the IT industry for over 7 years. I am graduated in Computer Science and information technology.