Home > Windows Server Tips > Active Directory Administration > Scripting domain controller installations: A must for Server Core
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ACTIVE DIRECTORY ADMINISTRATION

Scripting domain controller installations: A must for Server Core


Greg Shields, Contributor
02.13.2009
Rating: -4.71- (out of 5)


Expert advice on Active Directory and Group Policy
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Scripts for the automated installation of Microsoft Active Directory have been around since Windows 2000. At the same time, not many administrators have ever come across the need to script the installation of a domain controller (DC). While it's true that some large environments with hundreds or thousands of DCs may have used these scripts during massive rollouts, the majority of us have never gone further with the command line than typing "dcpromo" into a Windows Server's Run box … until now.

You see, Server Core in Windows Server 2008 arrives without a graphical user interface (GUI). This means that the bits and bytes that make up dcpromo's user interface simply can't be displayed on a Server Core instance. As such, the only way to turn a Server Core member server into a Server Core DC is through the command line. Server Core's minimal operating system combines perfectly with the typical DC's lightweight resource needs -- especially for virtualized DCs.

Let's take a look at a few examples of how to accomplish this.

First, the dcpromo command itself must be run from the command line. Running the command dcpromo /unattend:{pathToFile} will launch dcpromo and instruct it to gather its unattended installation parameters from the file at {pathToFile}. Be aware that running this command with the associated unattended installation file involves no further interaction by the administrator. For this reason, be very careful with the parameters you pass to dcpromo.

Below you'll see a basic unattended installation file for creating a brand new domain controller as the first DC in a new forest and domain, both named contoso.com:

You'll notice that the above file creates a new domain controller (as opposed to a replica DC) in a new forest. The DNS and NetBIOS names for the domain are both set in this file. The settings for ForestLevel and DomainLevel


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



RELATED CONTENT
Microsoft Active Directory Scripting
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
Reading computer names from a file

Microsoft Active Directory Design and Administration
Utilizing Active Directory snapshots in Windows Server 2008
Active Directory tops the list of hot Windows Server 2008 R2 features
Creating Windows taskpad views for Active Directory management
When to add new domains to your Windows environment
Forcing the removal of a Windows Server 2008 domain controller
Performing a staged installation of an RODC in Windows Server 2008
Using Active Directory to manage Macs in a Windows environment
Taming the LSASS.exe process for Active Directory performance and security
Top 5 Active Directory tips of 2008
Active Directory FAQs

Microsoft Windows Server 2008 Administration
Utilizing Active Directory snapshots in Windows Server 2008
How to configure backups and perform restores in Windows Server 2008
Using DFSR for SYSVOL replication in Windows Server 2008
Installing Server Core for Windows 2008 the easy way
File classification the automated way with Windows Server 2008 R2
Using DFS to create file system virtualization in Windows Server 2008
Internet Information Services (IIS) sees big changes in Windows Server 2008
Microsoft adds hypervisor support to Windows Server 2008 R2
File server migration tips for Windows Server 2008
Top five Server Core management tips for Windows 2008

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Active Directory  (SearchWindowsServer.com)

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


> correspond to the Forest Functional Level and Domain Functional Level of Windows Server 2008. A setting of 2 or 1 here would correspond to Windows Server 2003 and Windows Server 2000 Native Mode. This creation script is also configured to create a Global Catalog, the DNS delegation and the NTDS files in their default locations.

Be sure to enter a strong password for Directory Services Safe Mode into the SafeModeAdminPassword line. If you don't, running the script will bring forward a dialog box that requires you to enter that password, preventing this script from running fully unattended.

Here's a second example. If you need to add a second domain controller to an existing domain, you can use the following unattended installation file:

This file creates a replica DC for the contoso.com domain in the Default-First-Site-Name site. The server is configured with both DNS and Global Catalog services and replication of Active Directory objects is handled over the network. As before, usernames and passwords are needed for SafeModeAdminPassword, but here they are also required to authenticate to the domain. Enter the appropriate username and password for that domain authentication into the appropriate fields above.

Now where did I get these scripts? Did I code them by hand? No. I'll admit that I cheated, and you should as well. In Windows Server 2008, the very last screen of the dcpromo wizard on a full Windows system has been updated with a new button. That new button, marked Export settings, makes the process of generating the script above very simple.

Here's a trick for creating your own script without any scripting:

  1. First, log on to an existing full instance of Windows Server 2008 and run the dcpromo command.
  2. Answer the questions in the wizard as if you were answering them on your candidate Server Core DC.
  3. When you complete the wizard, do not click to continue past its final screen. Instead, click the Export settings button to save your settings into an unattended installation file.
  4. Transfer this file to your Server Core instance and use it with the dcpromo command to run the DC installation there.

By completing this series of actions, you can easily create the necessary unattended installation with little fear of missing necessary steps. The Export settings button logs each of the necessary configurations to an unattended installation file for you. Once created, simply adjust any settings as necessary as you reuse the file across multiple DC installations.

If you need more settings that aren't part of the default script, see Microsoft's extremely detailed knowledgebase article on how to use unattended mode to remove and install ADDS.


[IMAGE]Greg Shields, MCSE, is an independent author and consultant based in Denver with many years of IT architecture and enterprise administration experience. He is an IT trainer and speaker on such IT topics as Microsoft administration, systems management and monitoring, and virtualization. His recent book Windows Server 2008: What's New/What's Changed is available from Sapien Press.


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.




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 ExchangeTipsAsk the ExpertsMultimediaWhite 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