Managing Windows Server 2012 R2 Using PowerShell



In this lab I will guide you through the basic process of preparing a Window Server 2012 R2 computer to be a Domain Controller. This article assumes that you have successfully install the OS.


First, on the server, launch PowerShell as Administrator. Use the following commands for management


Renaming the server


Rename-computer “DCDEMO”




Changing Timezone / Time


Tzutil /g (this will show the current time zone)



Tzutil /l (list all available time zones)



Tzutil /s “Eastern Standard Time” (set the time zone to EST)



Set-Date “7:00:00 PM” (Set the time to 7PM)


Changing IP Address

Netsh interface? (shows all command options related to netsh interface)



Netsh interface show interface


Note that the interface name is “Ethernet



Netsh interface ip set address “Ethernet” static (set the interface with static IP address of, subnet mask of and default gateway of



Set the DNS:


Netsh interface ip add dns “Ethernet” (set the DNS server to be this server itself)


Note that the output says that DNS server is incorrect. That’s OK because at this point, our server is not itself a DNS server. We will configure this box to be a DNS server later.



Add a second DNS Server


Netsh interface ip add dns “Ethernet” index=2


Installing ADDS

Install-WindowsFeature AD-Domain-Services –IncludeManagementTools



Import-module ADDSDeployment



Install-ADDSForest –DomainName “Demo.Local” –DomainMode Win2012 –ForestMode Win2012 –InstallDNS –force




When installation is completed, the computer will be restarted automatically.



When the computer comes back up, log in as DEMO\Administrator.



Click Start, Administrative Tools to verify that you have all the Active Directory shortcuts as well as the DNS shortcut. This means your DC is ready.



Also, launch dnsmgmt.msc to verify that all DNS zones/records are properly configured.



Additionally, launch dsa.msc to verify Active Directory Users and Computers are configured properly.




Add a CNAME record in DNS

Dnscmd DCDEMO /recordadd Demo.Local Test2 CNAME

Now if we ping test2.demo.local, it actually ping because test2 is an alias of


Joining a client computer to the Domain

Add-computer –domain demo.local –credential “DEMO\Administrator”



That’s it!