Changing TCP/IP Information on Windows Server 2008 R2 Core Installation

I'm not a platforms person but needed to change the TCP/IP settings on a test server this week. A core installation does not have any GUI interfaces - at all. Reminds me of the old DOS days back in the 80's. Ugh.

After doing some research on the Internet, I came across a great blog describing, in detail, all the ins and outs of this process. For complete information, please visit https://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/.

The down and dirty way to change the TCP/IP settings of one network adapter, including multiple DNS server IP addresses, is to use the following PowerShell script. Be sure to change your IP numbers!!

$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq “TRUE”}
{
$NICS.EnableStatic(“192.168.171.42″, “255.255.255.0″)
$NICS.SetGateways(“192.168.171.1″)
$DNSServers = “198.102.234.125″,”198.102.234.126″
$NICS.SetDNSServerSearchOrder($DNSServers)
$NICS.SetDynamicDNSRegistration(“TRUE”)
$NICS.SetWINSServer(“198.102.234.125″, “198.102.234.126″)
}