How to set up ip address using power shell on server 2012 windows 7 windows 8 or windows 10

Setting up the IP Address for a Windows server 2012 or Windows 7, 8, or 10 computer using Powershell is three step process. This is the ideal way of setting up your 2012 Server Core IP address since there is no GUI interface on Server Core.

First disable the DHCP if you are in DHCP enabled environment where computers get IP addresses automatically.

get-NetAdapter ethernet | Set-NetIPInterface -dhcp disabled

Second, assign the IP address and Default Gateway.


Get-NetAdapter ethernet | new-NetIPAddress -IPAddress 192.168.1.100 -DefaultGateway 192.168.1.254 -PrefixLength 24

Third, set-up the the client DNS servers.

Set-DnsClientServerAddress -InterfaceAlias ethernet -ServerAddresses 8.8.8.8, 4.4.4.4

Note: My local network connection name is ethernet and that is the connection I set-up for static IP address. You can also use the same method for Wi-Fi or any other connection.

To get the connection alias, use Get-NetAdapter command.

Publisher: abdirahman isse

Share this post