Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

3.4. Automating the Promotion or Demotion of a Domain Controller

Problem

You want to automate the installation or removal of a domain controller. You can make the promotion process part of your standard build process by incorporating the necessary configuration lines in your answer file(s).

Solution

You can automate the promotion of a domain controller by using the unattended process when building the server or by manually running dcpromo after the system has been built. Pass an answer file containing the necessary lines to promote the server to dcpromo by specifying a /answer switch. Here is an example:

> dcpromo /answer:<path_to_answer_file>

If you want to run dcpromo as part of an unattended setup, you need to add a [GUIRunOnce] section in your unattended setup file that calls the dcpromo process. You can promote a domain controller only after setup has completed and someone logs in for the first time. That is why it is necessary to use a [GUIRunOnce] section, which sets the RunOnce registry key to kick off dcpromo after someone logs in. Here is an example:

[GUIRunOnce]
"dcpromo /answer:%systemroot%\system32\$winnt$.inf"

The dcpromo answer section starts with [DCInstall]. Here is an example answer file for adding a domain controller to an existing domain in the rallencorp.com forest:

[DCINSTALL] UserName=administrator Password=RAllencorpAdminPassword UserDomain=rallencorp.com DatabasePath=%systemroot%\ntds LogPath=%systemroot%\ntds SYSVOLPath=%systemroot%\sysvol SafeModeAdminPassword=DSrestoreModePassword ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata