Last active
April 22, 2021 14:35
-
-
Save bklockwood/94e55676c27db5c07b39 to your computer and use it in GitHub Desktop.
Setting up a new PC
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
#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