Home > Windows Server Tips > Active Directory Administration > Dcpromo using an unattended answer file
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ACTIVE DIRECTORY ADMINISTRATION

Dcpromo using an unattended answer file


By Gary Olsen, Contributor
04.05.2005
Rating: -4.17- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



Note: Before running Dcpromo, you may want to rename the computer to a name reflective of a DC (i.e. Corp-DC2 rather than Corp-SRV1), depending on your naming convention. However, Windows 2003 permits renaming a DC without demoting it.

On the member server, execute the following command from a command prompt:

C:> Dcpromo /adv /answer:C:\dcpromo-unattend.txt

Note: Specify the full path to the answer file.

If successful, the computer will reboot automatically at the end of Dcpromo. You shouldn't have to enter any information manually or interact with any dialogs. If you are prompted for any information, it means information is missing from the answer file.

Edit the Dcpromo-unattend.txt file. Note that the password field has been erased to prevent the admin password from existing in a simple text file.

Note: Using the answer file option in the Dcpromo command line will prevent the new dialog that prompts you for the location of the system state restore files from appearing, just as the answer file will prevent any GUI dialog from appearing for any questions that are correctly defined in the answer file.

Debugging:

  • The normal way to debug an answer file is to simply run the command line above. If there are any errors in the answer file, Dcpromo simply aborts the unattend mode and brings up the Wizard, requiring you to enter the missing information. Once you run Dcpromo and no GUI dialogs appear, you know the answer file is correct -- at least syntactically.
  • Make sure all the domain-specific information is correct.
  • Make sure the path to the answer file in the Dcpromo command line is correct.
  • Remember that the admin account and password are cleared each time you run the answer file, so if you run the command line and it prompts you for a username and password, re-enter them in the answer file. Of course you may want to have it prompt you for security reasons.

Clean up:
After the computer reboots, check to make sure Dcpromo was successful. From a command prompt, enter the command Net Share. You should then see Netlogon and Sysvol shares listed. If they don't show up, then the promotion wasn't successful, which would likely be due to failed replication. Also check the DNS settings.


Gary Olsen is an HP/Compaq consultant on Active Directory design. He authored Wi ndows 2000 Active Directory Design and Deployment and co-authored Windows Server 2003 on HP ProLiant Servers.
Not many administrators realize that they can run Dcpromo from an unattended answer file and eliminate all those cute little Wizard prompts. When combined with the Install from Media (IFM) option we discussed in Recovering a DC using 'Install from Media' last month, using an answer file makes Dcpromo a very easy operation when a domain controller (DC) has to be rebuilt in a remote site.

Consider one customer I worked with in the past. The company had a number of sites, and not all of them had an IT staff on the premises. At one site, the only technical person they had was the receptionist. The company sent her through some training so she had some basic IT skills. Thus, the IT staff members at another site could talk her through anything they needed her to do on site. If the DC had a hardware failure that required a DC to be rebuilt, an IT person could either do a CD install or issue a server image using RIS or other third-party products. Typically, it isn't a good idea to image a DC because there are continual changes, and the image would be out of date pretty quickly. To get it promoted, they could use IFM and ship a DVD or tape with the restored system state of a DC in the domain, but then they'd have to talk the receptionist through the Dcpromo prompts and hope she didn't make any typos. Of course they would also have to trust her with a domain admin account.

A better option for Dcpromo would be to use the unattended answer file option. They could put the answer file on the DVD with the backup state and direct the receptionist to simply enter the following command from the command line or just make a simple .bat file and have her run that from the DVD.

C:> dcpromo /adv /answer:c:scripts\answerfile.txt

The /adv option is required for IFM to let Dcpromo source from the local media. The /answer option ...

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Microsoft Active Directory Scripting
Scripting domain controller installations: A must for Server Core
Introducing Active Directory to Windows PowerShell
Simple WMI tricks for AD administrators
Active Directory LDAP scripting made simple
Extracting Active Directory info quickly and easily with LDIFDE
Scripting School: Connect scripts to remote computers
Taking computer names as arguments
Using WSH Controller
Connect scripts to remote computers: Summary
Reading computer names from Active Directory

Microsoft Active Directory Tools and Troubleshooting
How to find and remove lingering objects in Active Directory
DNS troubleshooting best practices
Generating a DNS health check in Windows
Debugging Windows client logon delays: Narrowing the scope
Troubleshooting poor Windows logon performance in Active Directory environments
New Operations Manager 2007 feature allows for automated agent deployments
Taming the LSASS.exe process for Active Directory performance and security
Active Directory FAQs
Troubleshooting Active Directory database errors
Troubleshooting a cross-forest trust in Active Directory

Active Directory Administration
How to find and remove lingering objects in Active Directory
Utilizing Active Directory snapshots in Windows Server 2008
Creating Windows taskpad views for Active Directory management
When to add new domains to your Windows environment
Debugging Windows client logon delays: Narrowing the scope
Using Active Directory to manage Macs in a Windows environment
Troubleshooting poor Windows logon performance in Active Directory environments
Common Active Directory security oversights
Scripting domain controller installations: A must for Server Core
Taming the LSASS.exe process for Active Directory performance and security

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


points to an answer file that would contain all the answers. In this case, the file is called "answerfile.txt" and is in the c:\scripts directory. Just provide the correct path in the command line, and it can exist in any directory of your choosing.

Example

Microsoft's Knowledge Base article 311078 is an excellent guide that contains samples for various answer files to promote the initial DC in a domain, a replica DC, and so on. The answer file shown here promotes a replica DC since IFM can only be used for replicas. Here is information about the various command lines so you know what is going on:

Steps:

  1. Create a file using the following commands. In our example, we call this file "Dcpromo-unattend.txt". Note that the credentials of an administrator account including the password are entered.
  2. If you run the answer file more than once, you must re-enter the admin account and password each time or the script will terminate at the screen asking for credentials.
Important: Remove all comment lines (lines prefixed with a semicolon) before using this as an answer file.


Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Server Room Design - Planning, Cooling, Maintenance
HomeTopicsBlogsITKnowledge ExchangeTipsNewsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2004 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts