Friday, March 1, 2013

Creating a Windows Server 2012 Domain Controller

I don't usually blog about Windows stuff here. Don't get me wrong. I use Windows a lot and was fairly impressed with Windows 7 (not so much with Windows 8). I run my production servers with CentOS Linux, but for my classes and videos, I need a Windows server. That's how I show things like Cisco VPN user authentication through Active Directory, for example. I recognize that's pretty important to a lot of people. So today I found myself installing Windows Server 2012. It occurred to me that there are couple tips that you might find helpful, especially if you're well-versed in older Windows server products, but not so much in Server 2012.

Remember how in Windows server products going all the way back to 2000, we would use dcpromo to elevate a server to a domain controller? Well, not anymore.  dcpromo has been deprecated. Of course, you can use the fancy new GUI, but it's a pain-in-the-rear, and it's just a lot easier to do it in the command line. So, open up PowerShell and execute two commands:

The first command adds Active Directory Domain Services to the server:

Add-WindowsFeature -name ad-domain-services -IncludeManagementTools

The second command creates a new domain controller in the root of a new forest (obviously, you'll want to change the domain name):
Install-ADDSForest –DomainName "soundtraining.local" 

You'll be asked to provide a directory service restore mode password, your server will whir for a few minutes, reboot, and before you know it, voila! You've got a domain controller in the root of a new forest. Not only that, but it automatically installs and configures a DNS server.

It's just as easy to add a domain controller to an existing forest. Use the following command:
Install-ADDSDomainController "soundtraining.class"

There are a ton of options a variations on the PowerShell Install command. To see them, type help install. To see the options for a particular command, type, for example, help Install-ADDSDomainController.

No comments: