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 22.214.171.124, 126.96.36.199
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