Created
January 24, 2019 13:44
-
-
Save spy86/4078a7d06e34df16c8d1cb14132a2ff3 to your computer and use it in GitHub Desktop.
Setting up the NIC, Renaming the Computer, and Rebooting
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
| # 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