Last active
October 27, 2018 10:37
-
-
Save niclaslindstedt/212a3b0693422724f8084db185a5b634 to your computer and use it in GitHub Desktop.
Useful PowerShell commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set IP-address | |
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress "192.168.1.200" -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 192.168.1.1 | |
# Set DNS server | |
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 1.1.1.1,1.0.0.1 | |
# Allow remote connections | |
Set-Item WSMAN:\localhost\Client\TrustedHosts -value RemoteComputerName -force | |
# Create AD forest | |
Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath "C:\Windows\NTDS" -DomainMode "Win2012" -DomainName <DOMAINNAME> -DomainNetbiosName <NETBIOSNAME> -ForestMode "Win2012" -InstallDns:$true -LogPath "C:\Windows\NTDS" -NoRebootOnCompletion:$false -SysvolPath "C:\Windows\SYSVOL" -Force:$true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment