Skip to content

Instantly share code, notes, and snippets.

@spy86
Created January 24, 2019 13:44
Show Gist options
  • Select an option

  • Save spy86/4078a7d06e34df16c8d1cb14132a2ff3 to your computer and use it in GitHub Desktop.

Select an option

Save spy86/4078a7d06e34df16c8d1cb14132a2ff3 to your computer and use it in GitHub Desktop.
Setting up the NIC, Renaming the Computer, and Rebooting
# Define the Computer Name
$computerName = "dc1"
# Define the IPv4 Addressing
$IPv4Address = "10.10.100.25"
$IPv4Prefix = "24"
$IPv4GW = "10.10.100.1"
$IPv4DNS = "8.8.8.8"
# Get the Network Adapter's Prefix
$ipIF = (Get-NetAdapter).ifIndex
# Turn off IPv6 Random & Temporary IP Assignments
Set-NetIPv6Protocol -RandomizeIdentifiers Disabled
Set-NetIPv6Protocol -UseTemporaryAddresses Disabled
# Turn off IPv6 Transition Technologies
Set-Net6to4Configuration -State Disabled
Set-NetIsatapConfiguration -State Disabled
Set-NetTeredoConfiguration -Type Disabled
# Add IPv4 Address, Gateway, and DNS
New-NetIPAddress -InterfaceIndex $ipIF -IPAddress $IPv4Address -PrefixLength $IPv4Prefix -DefaultGateway $IPv4GW
Set-DNSClientServerAddress –interfaceIndex $ipIF –ServerAddresses $IPv4DNS
# Rename the Computer, and Restart
Rename-Computer -NewName $computerName -force
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment