1. At domain controller, login as Domain Administrator.
2. Launch "Server Manager", expand "Roles".
3. Select "Active Directory Domain Services".
4. At the "Active Directory Domain Services" right pane.
5. Under "System Services", select "Active Directory Domain Services".
Figure 1: Active Directory Domain Services
6. Click "Stop".
Figure 2: Stop Dependent Services
7. Click "Stop Dependent Services".
8. Launch "Command Prompt", enter "ntdsutil".
9. Enter the following commands:
- Ntdsutil: Active instance NTDS
- Ntdsutil: Files
- File maintenance: compact to c:\
- File maintenance: quit
- Ntdsutil: quit
Figure 3: The process of Ntdsutil
The Active Directory Database file was back up to C:\ntds.dit
Restore the Active Directory database
1. At domain controller, login as Domain Administrator.2. Launch "Server Manager", expand "Roles".
3. Select "Active Directory Domain Services".
4. At the "Active Directory Domain Services" right pane.
5. Under "System Services", select "Active Directory Domain Services".
6. Click "Stop".
7. Click "Stop Dependent Services".
8. Copy you previous backup "ntds.dit" to replace "%windir%\ntds\ntds.dit".
Figure 4: Replace the ntds.dit
9. Launch "Registry Editor".
10. Navigate to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NTDS\Parameters
11. At right pane, delete "DSA Database Epoch".
Figure 5: DSA Databae Epoch
12. Back to "Server Manager", start the "Active Directory Domain Services" service.
13. Next to "Events", if the restoration successes, there is "Event ID 1000" in the "Events".
Figure 6: Event ID 1000
This posting is provided “AS IS” with no warranties, and confers no rights!
Nice :) When restoring from the backup onto a fresh install of Windows, are you just installing a dummy AD and then replacing the ntds.dit?
ReplyDeleteRegardless of what you do, you'll need to have or configure valid DNS servers to point to the correct Zones. This won't work for restoring a domain from scratch if you just have the .dit file. Also, SYSVOL and other workings would be missing too. You policies wouldn't be in place. Don't think you can use this if you are restoring a downed domain.
DeleteThe domain controller is the same as previous one.
ReplyDeleteI guess I could just do a quick lab of this, but what I was trying to ask you was how this would work in a disaster scenario when you have the ntds.dit file but had to resore it on a completely fresh install of Windows.
ReplyDeleteCould you just install 2008 R2, add the domain controller role, install a dummy domain in a dummy forest and copy the file in?
You can't install to a dummy domain in a dummy forest. The server can't boot up.
ReplyDeleteThis is my first time i visit here. I discovered a lot of interesting things within your blog especially its discussion.
ReplyDeletedomain service
my Primary DC failed. it doesn't work again. i tried to change slave DC to primary. But still couldn't change schema master role. Now what should i do. PLEASE HELP ME.
ReplyDeleteHello,
DeleteDo you seize the schema master role by ntdsutil?
Please read the following web sites for your information:
Using Ntdsutil.exe to transfer or seize FSMO roles to a domain controller
http://support.microsoft.com/kb/255504
Seize the schema master role
http://technet.microsoft.com/en-us/library/cc783650(v=ws.10).aspx
Ntdsutil
http://technet.microsoft.com/en-us/library/cc753343(v=ws.10).aspx
i just did everything what you show. but i my domain controller failed.
ReplyDeleteHello,
DeleteCould you provide more information about the domain controllers version, forest functional level, domain functional level?
IF you perform "netdom query fsmo" in a domain controller, what is the result?
I did the actions completely but my Windows 2008 SP2 continues to reboot automatically after replacing the database file. Any idea?
ReplyDeleteHello Milind,
ReplyDeleteCould you provide more information in your environment?
Do you restore the back up and restore the nrds.dit in the original one domain controller?
This method quickly got me out of trouble after messing around with service principal names on DC. Luckily i did IFM export shortly before, so this method worked a treat!!
ReplyDeleteThank You so much!
Thank you!
Delete