Skip to content

Instantly share code, notes, and snippets.

@bklockwood
Last active April 22, 2021 14:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bklockwood/94e55676c27db5c07b39 to your computer and use it in GitHub Desktop.
Save bklockwood/94e55676c27db5c07b39 to your computer and use it in GitHub Desktop.
Setting up a new PC
#Activate Windows
slmgr.vbs /ato
#Enable RDP (don't require Network Level Auth)
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 0
Enable-NetFirewallRule -Name RemoteDesktop-UserMode-In-TCP
#Allow ping, v4 and v6
New-NetFirewallRule -Name Allow_Ping4 -DisplayName "Allow IPV4 Ping" -Protocol ICMPv4 -Enabled True -Profile Any -Action Allow
New-NetFirewallRule -Name Allow_Ping6 -DisplayName "Allow IPV6 ping" -Protocol ICMPv6 -Enabled True -Profile Any -Action Allow
#Set static IPv4 address and gateway
New-NetIPAddress -InterfaceAlias "Ethernet" -AddressFamily IPv4 -IPAddress 10.0.0.200 -PrefixLength 8 -DefaultGateway 10.0.0.1
#Set Static IPv6 address and gateway
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 2601:8:b800:25b::2 -AddressFamily IPv6 -PrefixLength 64 -DefaultGateway 2601:8:b800:25b::1
#Set DNS Servers and register addresses
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.3,10.0.0.2
Register-DnsClient
#Add to domain and rename
add-computer -DomainName DOMAINNAME -newName COMPUTERNAME -Credential DOMAIN\USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment