Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's SharePoint Admin Blog > Posts > How to use PowerShell to replace DCPROMO in Windows Server 2012
September 23
How to use PowerShell to replace DCPROMO in Windows Server 2012

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 `
  7 win2008r2
  8  
  9 # Add the AD tools to the server
 10 Add-windowsfeature rsat-adds -includeallsubfeature
 11  
 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.

KURGAN 9-23-2012 10.29.23 PM

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.

Enjoy,

tk

ShortURL: http://www.toddklindt.com/PoshDcpromo

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.

Comments

Re: How to use PowerShell to replace DCPROMO in Windows Server 2012

I love change for the sake of change.  Really.  Although it does make it nice to fire it up on the core OS.
 on 11/2/2012 4:34 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 Please Support my Sponsors