Skip Ribbon Commands
Skip to main content
... Falcon IT Services, Miami, FL ...

IT Knowledgebase

Dec 10
How to set the NIC IP Address using PowerShell in Server Core 2012

If you are running Server Core 2012 (or PowerShell V3), here are instructions on how to configure the NIC's TCP/IP network IPV4 properties using PowerShell.

First open PowerShell by typing PowerShell at the command prompt and pressing enter.

At the command prompt, type Get-NetIPAddress and press enter.

Look for the interface alias in the IPV4 adapter.

Type the New-NetIPAddress –interfaceAlias command and use the Interface Alias from the IPV4 adapter encapsulated between quotation marks.

New-NetIPAddress –InterfaceAlias "Ethernet" –PrefixLength 24 –DefaultGateway 192.168.16.1

You will be prompted to enter the IP address.

Once the IPV4 address has been set, use the following command to set the subnet mask and default gateway.

Note: -PrefixLength 24 is a /24 CIDR mask that indicates a class C subnet (subnet mask 255.255.255.0). If you have a different subnet mask to use, you can easily calculate it here.

To configure DNS using PowerShell, execute the following command:

Set-DNSClientServerAddress –InterfaceAlias "Ethernet" –ServerAddress 192.168.16.10, 192.168.16.11

This will set your primary and secondary DNS IP addresses.

To remove an IP address, use the Remove-NetIPAddress command:

 

Comments

There are no comments for this post.

 ‭(Hidden)‬ Blog Tools

IT Services Miami

 Falcon IT Services, Miami, FL

​Falcon IT Services provides computer and network services and support to small and medium sized businesses in Miami, Fl.