Windows Server 2003 AD Backup and Disaster Recovery Procedures
Windows Server 2003 AD Backup and Disaster Recovery Procedures
Version: 2.1
1. Contents
1. CONTENTS ........................................................................................................................................... 2 2. CONTACT INFORMATION ....................................................................................................................... 4 3. VERSION CONTROL .............................................................................................................................. 5 4. TERMS AND ABBREVIATIONS ................................................................................................................. 5 5. INTRODUCTION ..................................................................................................................................... 6 5.1 System State Backup and Restore Content ................................................................................. 6 5.2 Backing up GPOs ......................................................................................................................... 7 5.3 When to Restore ........................................................................................................................... 7 5.4 Where to Restore .......................................................................................................................... 8 5.5 Restoring Back-Links .................................................................................................................... 8 5.5.1 Restore group memberships through NTDSUTIL and LDIFF ................................................. 8 5.5.2 Restore security principals two times ...................................................................................... 9 6. COMMON TASKS ................................................................................................................................ 10 6.1 Remove Domain Controller from DNS........................................................................................ 10 6.2 Remove Domain Controller from Active Directory ...................................................................... 10 6.3 Change the Active Directory Restore Mode Administrator Password ........................................ 11 6.4 Verification of a Successful Restore ........................................................................................... 12 6.5 Non-authoritative restore through RDP ...................................................................................... 12 7. ACTIVE DIRECTORY CONTENT RECOVERY ........................................................................................... 13 7.1 Overview ..................................................................................................................................... 13 7.1.1 Authoritative Restore ............................................................................................................. 13 7.1.2 Non-Authoritative Restore ..................................................................................................... 13 7.2 Domain Naming Context Recovery ............................................................................................ 14 7.2.1 Non-Authoritative Restore ..................................................................................................... 14 7.2.2 Authoritative Restore ............................................................................................................. 14 7.3 Configuration Naming Context Recovery ................................................................................... 15 7.3.1 Non-authoritative Restore ...................................................................................................... 16 7.3.2 Authoritative Restore ............................................................................................................. 16 7.4 Schema Naming Context Recovery............................................................................................ 16 8. DOMAIN CONTROLLER RECOVERY ...................................................................................................... 17 8.1 Recovery from Replication .......................................................................................................... 17 8.2 Recovery from Backup................................................................................................................ 17 9. ENTIRE DOMAIN RECOVERY................................................................................................................ 18 9.1 Recover System State ................................................................................................................ 18 9.2 Clean up Active Directory and Forest ......................................................................................... 18 10. ENTIRE FOREST RECOVERY................................................................................................................ 20 10.1 Active Directory Schema............................................................................................................. 20 10.2 Rules to follow ............................................................................................................................. 20 10.3 Restore Procedure ...................................................................................................................... 20 11. FSMO ROLES RECOVERY .................................................................................................................. 21 11.1 Overview ..................................................................................................................................... 21 11.2 Recovering or Seizing an FSMO Role ........................................................................................ 21 11.2.1 Recovering the Schema Master ............................................................................................ 22 11.2.2 Recovering the Domain Naming Master ................................................................................ 22 11.2.3 Recovering the RID Master ................................................................................................... 22 11.2.4 Recovering the PDC Emulator .............................................................................................. 22 11.2.5 Recovering a Global Catalog ................................................................................................. 22 11.2.6 Recovering the Infrastructure Master .................................................................................... 23 11.3 How to find the existing FSMO role holders ............................................................................... 23 11.4 How to Seize a Role ................................................................................................................... 23 11.5 How to Move a Role .................................................................................................................... 24 12. SYSVOL RECOVERY ......................................................................................................................... 25 12.1 Overview ..................................................................................................................................... 25 12.2 Authoritative SYSVOL Restore during AD Restore .................................................................... 25
2/32
3/32
2. Contact Information
IT doesnt matter
Even in our fast growing world of technology, IT became a commodity the same way as electricity did. Its not the software, hardware or technologies that will make the difference, but the way how you design, implement, maintain and use it. Speaking personally, as an architect, software, hardware and technology as such are not that important. They are only a way to create a stable, reliable and secure IT infrastructure to meet all your business and technical needs. Cost reductions, flexibility and future scalability are key words in every project Im involved with.
EDE Consulting
EDE Consulting was formed in 2006. Though a young company, all our IT professionals are senior consultants with 10 to 20 years of experience in IT business. EDE Consulting has extensive experience with everything related to enterprise system management, network management, system migration and integration, and this at consultancy, architectural and implementation level. While you take care of your core business, EDE Consulting looks after your IT infrastructure. We think beyond the technical aspects of IT. If, for example, we design a disaster recovery procedure, this procedure includes all documentation, personal procedures, access lists, and so on. Among our current customers you will find: Fortis, Dexia, ING, Oleon, AGF, KUL, ...
http://www.linkedin.com/pub/peter-van-keymeulen/3/531/783
4/32
3. Version Control
Version Status V2.0 Final V2.1 Update Date 15.03.2011 28.04.2011 Authors Van Keymeulen Peter Van Keymeulen Peter Changes
5/32
5. Introduction
Recovering a Windows 2003 Domain Controller requires more care and attention to detail than the equivalent operation in Windows NT 4.0. Domain Controllers can assume numerous roles within an Active Directory infrastructure: global catalogs, operations masters, and simple domain controllers. This paper describes the steps you use to recover the Active Directory database after a failure, the associated considerations, and the issues you need to keep in mind when restoring a server to a special role.
The contents of the registry are backed up when you backup system state data. In addition, a copy of your registry files is also saved in the folder %systemroot%\repair\RegBack, allowing you to restore the registry without doing a complete system state restore. The Component Object Model (COM) is a binary standard for writing component software in a distributed systems environment. The Component Services Class Registration Database is backed up and restored with the system state backup.
6/32
7/32
In variations of this scenario, user accounts, computer accounts, or security groups may have been deleted individually or in some combination. In all these cases, the same initial steps apply-you authoritatively restore those objects that were inadvertently deleted. Some deleted objects require more work to be restored. These objects include objects such as user accounts that contain attributes that are back links of the attributes of other objects. Two of these attributes are managedBy and memberOf. If your DCs are running Windows Server 2003 SP1 and the forest operates at the Windows Server 2003 Forest Functional Level. There are two methods: 1. Restore the deleted user accounts, and then add the restored users back to their groups by using Ntdsutil.exe 2. Authoritatively restore the deleted user accounts and the deleted users' security groups two times. 5.5.1 Restore group memberships through NTDSUTIL and LDIFF For each user that you restore, at least two files are generated. These files have the following format: ar_YYYYMMDD-HHMMSS_objects.txt This file contains a list of the authoritatively restored objects. Use this file with the ntdsutil authoritatative restore "create ldif file from" command in any other domain in the forest where the user was a member of Domain Local groups. ar_YYYYMMDD-HHMMSS_links_usn.loc.ldf
8/32
5.5.2 Restore security principals two times To restore all security principals twice: Authoritatively restore all deleted user accounts and all security groups, for more information please refer to: 7.2.2 Authoritative Restore. Reboot the system in normal Active Directory operation mode Wait for the end-to-end replication of the restored users and of the security groups to all the domain controllers in the deleted user's domain and to the forest's global catalog domain controllers. Repeat step 1,2 and 3 once again. If the deleted users were members of security groups in other domains, authoritatively restore all the security groups that the deleted users were members of in those domains. Or, if system state backups are current, authoritatively restore all the security groups in those domains.
9/32
6. Common Tasks
This part of the document contains tasks which are used in almost every type of restore. References to these tasks are made throughout the document.
Type: c and press return to enter the connection part. Type: Connect to server <servername> where the server name is the name of the remaining domain controller, not the name of the server you have to remove from the directory. Type: Q (and return) to leave the connection part. Type: s o t to enter the Select Operation Target part of ntdsutil Type: list sites to get all existing sites for the forest Type: select site <number> Where the number should be the number of the site on which the to be removed server is located. Type: list domains in site to get the list of all domains on that site. Type: select domain<number> where the number should be the number of the domain for which the to be removed server was a domain controller. Type: list servers for domain in site to get all domain controllers for the selected domain on the selected site.
10/32
11/32
To access the DC in AD Restore mode through RDP: Change the boot.ini file on the domain controller by adding the following line to it:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003" /safeboot:dsrepair /sos
Keep in mind that the /SAFEBOOT parameter doesnt work in combination with some other parameters. The /SAFEBOOT will be ignored when, for example, the /fastdetect option is used too. Make sure you put this new line on the first place in the list, either manual or through the System Properties / Advanced / Startup and Recovery options. Before you reboot the system, be sure you know the DSRM password. For more information, please refer to: 6.3 Change the Active Directory Restore Mode Administrator Password. Reboot the system and connect to it through RDP
12/32
7.1.1 Authoritative Restore An authoritative restore is, in essence, an extension of the non-authoritative restore process. That is, it requires all the steps of a non-authoritative restore before it can be initiated. The authoritative restores distinguishing characteristic is that it increments the version number of an entire directory, a subtree, or individual objects (provided that they are leaf objects) to mark them as authoritative in the directory. As with a non-authoritative restore, once a DC is back online, it contacts its replication partner(s) to see what has changed since the last backup. But because the version number of the object(s) restored is higher than the existing instances of those objects held on replication partner(s), the objects on the restored DC appear to be more recent and, therefore, must be replicated out to the rest of the DCs within the environment. (By default, version numbers are incremented by 100,000 under the authoritative restore process.) Because of this, the authoritative restoration method is typically used when human error is involved, such as when an administrator has accidentally deleted an OU. Unlike a non-authoritative restore, an authoritative restore requires the use of a separate application: NTDSUTIL. No backup utilities (at the time of this writing), including the native Windows 2000 utility, can perform an authoritative restore. An authoritative restore does not overwrite new objects created after the backup occurred. An authoritative restore can be carried out only on objects from the configuration and domain contexts. The authoritative restore of schema components is not supported 7.1.2 Non-Authoritative Restore Non authoritative restore is the default method for the restoration of Active Directory, and is used for the majority of restore operations. Using this method, the settings and entries that existed in the Domain, Schema, Configuration, and (optionally) Global Catalog naming contexts maintain the version number they had at the time of backup. After a non-authoritative restore, the DC is updated using normal replication techniques. That is, if the version number of an object is less than the same objects version number stored by its replication partner(s) (indicating the object has changed since it was last backed up), the object on the restored server is updated. This ensures an up-to-date version of the database.
13/32
Windows Server 20003 AD Backup and Disaster Recovery Procedures 7.2 Domain Naming Context Recovery
The domain naming context contains all users, groups, computers and other objects. 7.2.1 Non-Authoritative Restore To restore the Domain Naming Context or parts of it non-authoritatively: Change the DSRM password if you dont know it. For more information, please refer to: 6.3. Change the Active Directory Restore Mode Administrator Password. Restore, the necessary NTBACKUP file you backed-up to another location. Be sure you restore the correct file. Never use a file from another Domain Controller. Reboot the server in the Directory Services Restore mode by pressing the F8 button during the boot phase. Log on to the system using the Administrator account and DSRM password. Start ntbackup.exe. Do not use the wizard mode. Select the Restore and Manage Media tab. Select, from the existing list, the file you need. If you restored the file to another location, right click on File, select Catalog file and select the file you restored through your backup system. Mark the System State box for restoration. Select Restore Files To: Original Location Start Restore Select OK Select OK, do not change the Advanced options At the end of the restore, select yes to reboot. The system will reboot and automatically start replicating, from another domain controller, all changes made between now and the time of the backup. Validate the successful restore, please refer to: 6.4.Verification of a Successful Restore
7.2.2 Authoritative Restore Remark: When users and groups have to be restored together, some kind of special order has to be followed. For more information, please refer to: 5.5 Restoring BackLinks. To restore the Domain Naming Context or parts of it authoritatively: Change the DSRM password if you dont know it. For more information, please refer to: 6.3. Change the Active Directory Restore Mode Administrator Password. Restore, the necessary NTBACKUP file you backed-up to another location. Be sure you restore the correct file. Never use a file from another Domain Controller Reboot the server in the Directory Services Restore mode by pressing the F8 button during the boot phase. Log on to the system using the Administrator account and DSRM password.
14/32
To restore one computer object, type: Restore Object <distinguished name of the computer object> and select yes. Dont forget the quotes around the distinguished name! To restore an OU container without his child objects, type Restore Object <distinguished name of the OU> and select yes. Dont forget the quotes around the distinguished name! To restore an entire OU container and all his child objects, type Restore Subtree <distinguished name of the OU> and select yes. Dont forget the quotes around the distinguished name! To restore an entire Active Directory, that is; the entire content of one domain, type Restore Database and select yes
Close ntdsutil Reboot the system. This domain controller becomes the master for the domain and all restored data will be replicated to all other domain controllers in the domain. Validate the successful restore, please refer to: 6.4.Verification of a Successful Restore
15/32
16/32
17/32
18/32
Copy the entire content of the D:\SYSVOL to another location Stop the NTFRS service In the registry, locate the BurFlags value in the following location:
HKLM\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Process at Startup
o o o o o o
Change his value to D4 (HEX) Restart the NTFRS service This domain controller will now be the SYSVOL master Wait until the SYSVOL and NETLOGON Share are present Copy the SYSVOL share content from the backup to the share Validate the successful restore, please refer to: 6.4.Verification of a Successful Restore
Add additional domain controllers through normal staging procedures using the most recent domain controller profile. Reshuffle the recovered server with the latest domain controller profile. Validate the successful restore, please refer to: 6.4.Verification of a Successful Restore.
19/32
10.3
Restore Procedure
To restore an entire forest: For each domain, stage one member server in another existing forest of the same environment using the same IP address and hostname as the original DCs. Starting at the root domain, restore the necessary NTBACKUP file you backed-up to another location. Starting at the root domain, restore the entire Active Directory Database. For more information, refer to: 8.2. Recovery from Backup. For the restored domain, remove all other remaining domain controllers from the AD. For more information, please refer to: 6.2. Remove Domain Controller from Active Directory. Move all domain based FSMO roles to the recovered domain controller. For more information, please refer to: 11.2. Recovering or Seizing an FSMO Role Using normal staging procedures, stage all other additional domain controllers for the restored domain. Repeat all previous steps for each domain within the forest with respect for the domain hierarchy.
20/32
Goals
Makes changes to the forest-wide domain name space of the directory Processes RID Pool requests from all DCs within a given domain Synchronize time in an enterprise. Account lockout is processed on the PDC emulator. Password changes performed by other DCs in the domain are replicated preferentially to the PDC emulator. The infrastructure FSMO role holder is the DC responsible for updating an object's SID and distinguished name in a cross-domain object reference.
Domain
PDC Emulator
Domain
Infrastructure Master
Domain
21/32
22/32
Type: Select Operation Target Type: List roles for connected server to be sure all seized roles are now on your domain controller Close ntdsutil Restart the netlogon service
23/32
Windows Server 20003 AD Backup and Disaster Recovery Procedures 11.5 How to Move a Role
To seize a role: Start, on the command prompt on a remaining domain controller, ntdsutil Type, without the quotes: roles and press return to enter the FSMO Maintenance part of ntdsutil Type: Select Operation Target and press return to enter the connection part Type: Connections Type: Connect to server <servername> where the server name is the name of the remaining domain controller on which you have to install the role Type: Q to leave Type: Q to leave Type: transfer <role> , where the role could be one of the following: o o o o o PDC Domain naming master Infrastructure master RID Master Schema master
Type: Select Operation Target Type: List roles for connected server to be sure all seized roles are now on your domain controller Close ntdsutil Restart the netlogon service
24/32
25/32
Windows Server 20003 AD Backup and Disaster Recovery Procedures 12.3 Authoritative Restore of SYSVOL Only
Change the DSRM password if you dont know it. For more information, please refer to: 6.3. Change the Active Directory Restore Mode Administrator Password. Restore, the necessary NTBACKUP file you backed-up to another location. Be sure you restore the correct file. Never use a file from another Domain Controller. Reboot the server in the Directory Services Restore mode by pressing the F8 button during the boot phase. Log on to the system using the Administrator account and DSRM password. Start ntbackup.exe. Do not use the wizard mode. Select the Restore and Manage Media tab. Select, from the existing list, the file you need. If you restored the file to another location, right click on File, select Catalog file and select the file you restored from your backup system. Mark the System State box for restoration. Choose alternate location to restore the system state on it Start the restore by clicking on the Start Restore button Be sure that Restore junction points is NOT selected. Leave all the other options on their default setting. Start restore If finished, close the utility Reboot the server Logon to the server Wait until SYSVOL is published to other domain controllers. This can take a while. SYSVOL is published from the moment that the following shares are created: o NETLOGON o SYSVOL Copy the contents of the SYSVOL on the alternative location to the operational SYSVOL From this point on, SYSVOL will be replicated to all other domain controllers
26/32
27/32
On a domain controller on the Delayed Replicated Site, logon using Enterprise Admin Rights. Change the DSRM password if you dont know it. For more information, please refer to: 6.3. Change the Active Directory Restore Mode Administrator Password. Reboot the server in the Directory Services Restore mode by pressing the F8 button during the boot phase. Log on to the system using the Administrator account and DSRM password. On the command prompt, start ntdsutil Type: Authoritative Restore
To restore the entire Active Directory, that is; the entire content of one domain, type Restore Database and select yes
Close ntdsutil Reboot the system. This domain controller becomes the master for the domain and all restored data will be replicated to all other domain controllers in the domain. Force a replication across all site links to replicate the restored objects to the other sites immediately. Validate the successful restore, please refer to: 6.4.Verification of a Successful Restore
28/32
To address one or both above issues: Some manual interventions in both cases. Install additional domain controllers on the remaining sites Move all failed roles to domain controllers on the remaining sites
29/32
15.3.1 Common tasks when going into DR mode Once the DRP has been started all of the following manual interventions have to be initiated: Shutdown all domain controllers on the remaining site (if she still exists) The DNS team should, for each domain controller on the failing site: o o o Remove the A and PTR record for the server name from the DNS Remove the A record for the domain for the server from the DNS Remove all SRV records for the server from the DNS
The DNS team should, once the DNS cleanup has been done, launch a full regeneration of the DNS zones and forces a full replication to all secondary DNS servers.
15.3.2 Installing additional domain controllers Please refer to the documentation regarding the XBOW server staging procedures for the server. Remark: Keep in mind that new domain controller should have write access to all _zones of his own domain and some _zones of the forest root domain. So please inform the DNS people to grant the new server all necessary rights. They know exactly what rights.
15.3.3 Move all FSMO roles To know which roles are missing or which role exists on which server, please refer to: 11.3 How to find the existing FSMO role holders
15.4 To Seize a role, please refer to: 11.4 How to find the existing FSMO role holders
Start, on the command prompt on a remaining domain controller, ntdsutil Type, without the quotes: roles and press return to enter the FSMO Maintenance part of ntdsutil Select Meta Cleanup Select Select Operations Target Select Connections Select Connect to server <local dc name> Select Q Select List roles for connected server
30/32
Windows Server 20003 AD Backup and Disaster Recovery Procedures 15.5 How to move back to the original operation level
This part describes how we can switch over from DRP mode back to normal operations mode, meaning that the site failed site is back online. Be sure all domain controllers have the necessary rights to update and or create their SRV records in the DNS. Be sure the A and the PTR record for the servers exists and that their A record also exist on the domain record. Power on all domain controllers which did not have any FSMO role before the DRP started. Verify if, after the boot, all necessary SRV records for each server exists. To do, log onto the server and launch the CheckDNS.exe tool. Ask the DNS people to force a full regeneration of all zones and force a full replication to each secondary DNS server. Reinstall all domain controllers which maintained a FSMO role before the DRP started. Verify if, after the boot, all necessary SRV records for the reinstalled server exists. To do, log onto the server and launch the CheckDNS.exe tool. Ask the DNS people to force a full regeneration of all zones and force a full replication to each secondary DNS server. Move all FSMO roles to their original server. For more information, please refer to: 7.5 How to move a Role
31/32
16. References
16.1 Microsoft TechNet and Knowledge Base Articles
Q316790 The SYSVOL and NETLOGON Share are missing after you Restore a Domain Controller from Backup. Troubleshooting Missing SYSVOL and NETLOGON Shares on 2000 Domain Controllers. How to rebuild the SYSVOL tree and its content in a domain? How to restore deleted user accounts and group memberships in Active
Q257338
Q315457
32/32