set up a domain controller with powershell

Need to set up all aspects of a simple DC with powershell.

Starting from and empty win 2012 server I need to add the server role, promote it to DC, create OUs (organisational units), groups, users and so on and so forth.

The script can be run locally on (the soon to be) DC.

It's a very simple design:

DC (hosting MYDOMAIN)
COMPUTER1 (member)
COMPUTER2 (member)
COMPUTER3 (member)


Please provide links and examples!
Ron DokkensirAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ron DokkensirAuthor Commented:
x-menIT super heroCommented:
dan_blagutCommented:
Hello

Once your controller is up and running you will need of:
New-ADOrganizationalUnit for the OU
https://technet.microsoft.com/fr-fr/library/ee617237.aspx?f=255&MSPPError=-2147217396 
New-ADGroup for the groups
https://technet.microsoft.com/en-us/library/ee617258.aspx
New-ADUser for users accounts
https://technet.microsoft.com/en-us/library/ee617253.aspx
New-ADReplicationSubnet for sites you have more than one
https://technet.microsoft.com/en-us/library/hh852206(v=wps.630).aspx

And yes rewriting an AD deployement procedure in powershell can be an excellent ideea of article for this site and your business.

Dan

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ron DokkensirAuthor Commented:
>>Once your controller is up and running..

A nice trick is to do it manually once - windows (2012) will actually let you save the powershell for it.

However - I also had to add this line to the scipt - in order to get some GUI features.
Install-WindowsFeature RSAT-AD-Tools

Open in new window


Use command
get-windowsfeature

Open in new window

to see what you have installed or not
Ron DokkensirAuthor Commented:
One of the better resources on the web - for other scripting as well

http://ss64.com/
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.