The year 2012 is turning out to be a pretty big one for Microsoft software releases. Windows Server 2012 is just one of the many exciting products that has come out so far this year. As with any new release, there are some changes and some opportunities to stretch our wings and learn new stuff. In this blog post I’ll tell you about how Windows Server 2012 no longer has DCPROMO (Booooo!) and how I replaced it with PowerShell (Yay!!).
I was setting up a new SharePoint 2013 VM the other day (mainly because Shane was having trouble, and I needed to demonstrate once again that I’m smarter than he is) and when I was creating the domain I discovered that Windows 2012 no longer includes DCPROMO.EXE, the tool that creates domains. There is a pretty straight forward way to do this in the UI, but that’s no fun. You know what’s fun? PowerShell! That’s what’s fun. So here’s the code I used to create and configure my Contoso domain:
1 # Add the AD Module
2 Import-module servermanager
3 Add-WindowsFeature AD-Domain-Services
4 # Create a new forest which creates a root domain
5 Install-addsforest -domainname contoso.com -safemodeadministratorpassword (convertto-securestring `
6 "pass@word1" -asplaintext -force) -domainmode win2008r2 -domainnetbiosname contoso -forestmode `
9 # Add the AD tools to the server
10 Add-windowsfeature rsat-adds -includeallsubfeature
12 # Set the domain passwords to not expire
13 Set-ADDefaultDomainPasswordPolicy contoso.com -ComplexityEnabled $false -MaxPasswordAge "3650" `
14 -PasswordHistoryCount 0 -MinPasswordAge 0
The comments in the code document it pretty well. I add the module, create the forest, including the root domain. Then I add the AD management tools. Pretty simple. If you have questions about the options you have with Install-ASDSForest you can use the Get-Help cmdlet to get a full list.
Once the tools are installed you’ll need to right click on them to get the “Run as Administrator” or “Run as different user” options.
Once you have AD installed you can use the PowerShell script I published before to create accounts. It works as well in Windows 2012 as it does Windows 2008 R2.
Edit: 10/6/2012 to fix the code so it didn’t cause scrolling
Edit: 11/7/2012 to fix some typos. Good lord, it was tragic.
Edit: 11/7/2012 to fix the ShortURL. I am absolutely a mess.