Building a Windows Server 2016 Domain Controller #winserv #Hybrid #cloud #Azure #powershell

Building a Domain Controller is not that Difficult but what about building this with Powershell and use the 2016 Bits.

Well lets take a peek at the Technet site https://technet.microsoft.com/en-us/library/hh974720(v=wps.630).aspx nothing about 2016.

-DomainMode<DomainMode>

Specifies the domain functional level of the first domain in the creation of a new forest. Supported values for this parameter can be either a valid integer or a corresponding enumerated string value. For example, to set the domain mode level to Windows Server 2008 R2, you can specify either a value of 4 or Win2008R2. So

The following are the supported values:
     — Windows Server 2003: 2 or Win2003
     — Windows Server 2008: 3 or Win2008
     — Windows Server 2008 R2: 4 or Win2008R2
     — Windows Server 2012: 5 or Win2012
     — Windows Server 2012 R2: 6 or Win2012R2

Well it makes sense that the Next line would be  — Windows Server 2016: 7 or Win2016

Le me try that in Azure.

First I deploy the windows feature Active Directory

Install-windowsfeature AD-domain-services -IncludeAllSubFeature –IncludeManagementTools

The next step would be Deploy Active Directory and at the end you will be asked for a recovery password.

Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "7" `
-DomainName "mvpdemo01.local" `
-DomainNetbiosName "mvpdemo01" `
-ForestMode "7" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-Force:$true

I did a Force:$true So a reboot is following so no time for a screenshot and wait for things.!

But After the reboot you will have a DC

image

and Joining a DC Member : Add-WindowsFeature AD-Domain-Services

Install-windowsfeature AD-domain-services -IncludeAllSubFeature –IncludeManagementTools

Add-WindowsFeature AD-Domain-Services `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "7" `
-DomainName "mvpdemo01.local" `
-DomainNetbiosName "mvpdemo01" `
-ForestMode "7" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoGlobalCatalog:$false `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-Force:$true

 

Joining a Member server

I created a noob account that is only allowed to join a server to the domain

 

Write-Host "Hostname / Node Names" -ForegroundColor yellow
$domain = "mvpdemo01.local"
$password = "Password01" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\noob"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
restart-computer -force

image

See how easy things can be.

 

 

Flickr Tags: Windows Server 2016,CloudOS

Follow Me on Twitter @ClusterMVP

Follow My blog https://robertsmit.wordpress.com

Linkedin Profile Http://nl.linkedin.com/in/robertsmit

Google Me : https://www.google.nl

Bing Me : http://tinyurl.com/j6ny39w

LMGTFY : http://lmgtfy.com/?q=robert+smit+mvp+blog

Author: Robert Smit [MVP]

Robert Smit is Senior Technical Evangelist and is a current Microsoft MVP in Clustering as of 2009. Robert has over 20 years experience in IT with experience in the educational, health-care and finance industries. Robert’s past IT experience in the trenches of IT gives him the knowledge and insight that allows him to communicate effectively with IT professionals who are trying to address real concerns around business continuity, disaster recovery and regulatory compliance issues. Robert holds the following certifications: MCT - Microsoft Certified Trainer, MCTS - Windows Server Virtualization, MCSE, MCSA and MCPS. He is an active participant in the Microsoft newsgroup community and is currently focused on Hyper-V, Failover Clustering, SQL Server, Azure and all things related to Cloud Computing and Infrastructure Optimalization. Follow Robert on Twitter @ClusterMVP Or follow his blog https://robertsmit.wordpress.com Linkedin Profile Http://nl.linkedin.com/in/robertsmit Robert is also capable of transferring his knowledge to others which is a rare feature in the field of IT. He makes a point of not only solving issues but also of giving on the job training of his colleagues. A customer says " Robert has been a big influence on our technical staff and I have to come to know him as a brilliant specialist concerning Microsoft Products. He was Capable with his in-depth knowledge of Microsoft products to troubleshoot problems and develop our infrastructure to a higher level. I would certainly hire him again in the future. " Details of the Recommendation: "I have been coordinating with Robert implementing a very complex system. Although he was primarily a Microsoft infrastructure specialist; he was able to understand and debug .Net based complext Windows applications and websites. His input to improve performance of applications proved very helpful for the success of our project

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: