Set Windows Server Core 2016 IP Address Using PowerShell

Following my Windows Server Core 2016 Installation article from Yesterday, Today I’ll show you how I configure Windows Core 2016 IP Address And DNS using PowerShell.

In the example, below I’m using the Hyper-V console to setup the IP address.

The first step In the process Is to view the current configuration, reset it and remove the default gateway using the cmdlets below.

Get-NetIPConfiguration
Remove-netipaddress -interfaceIndex 2
Remove-NetRoute –NextHop "192.168.0.1"

Once done I’ll check again If the configuration Is clean.

Get-NetIPConfiguration

To setup the IP address and Default Gateway I’m using the cmdlet below:

New-NetIPAddress -InterfaceIndex 2 -IPAddress 192.168.0.15 -PrefixLength 24 -DefaultGateway 192.168.0.1

Next, I’ll setup the DNS Server address.

Set-DnsClientServerAddress -InterfaceIndex 2 -ServerAddresses "192.168.100.10"

Leave a Reply