# # Windows PowerShell script for AD DS Deployment #Do no forget to rename the computer, set static IP, enable remote desktop if needed and so on # Install-WindowsFeature AD-Domain-Services Install-ADDSForest ` -CreateDnsDelegation:$false ` -DatabasePath “C:\Windows\NTDS” ` -DomainMode “Win2012” ` -DomainName “domain.name.com” ` -DomainNetbiosName “DOMAIN” ` -ForestMode “Win2012” ` -InstallDns:$true ` -LogPath “C:\Windows\NTDS” ` -NoRebootOnCompletion:$false ` -SysvolPath “C:\Windows\SYSVOL” ` -Force:$true #Add Secondary DC # # Do not forget to rename the computer first Rename-Computer -NewName whatever #Set Static IP and DNS #Could be done with interface index as well #get-wmiobject win32_networkadapter | select netconnectionid, name, InterfaceIndex, netconnectionstatus #netconnection status 2 gives us only connected adapters 🙂 New-NetIPAddress -InterfaceAlias Ethernet -IPAddress YOURSERVERIP -DefaultGateway GATEWAYIP -AddressFamily IPv4… Read More »Install Primary and Additional Domain Controller With PowerShell Cheat Sheet
Few days ago I managed to close my powershell window during an remote desktop session to a core server and I stumbled silly into the empty screen 🙂 After googling for a while I learned that your savior in this situation is: CTRL + ALT + END Give it a try, it is really worthy!
If someone ever wondered how to change time, timezone or date in a powershell session or in a core server here is how. If today is 27 May 2017 and we want to set the clock to 16:12: Set-Date -Date “5/27/2017 16:12” More on this here. If only the timezone needs to be changed lets say to Central European: Set-TimeZone -Id “Central European Standard Time” List of all time zones could be obtained in powershell with the following command (Thank you scriptingguy you are priceless): [System.TimeZoneInfo]::GetSystemTimeZones()