We are concentrating on PowerShell on Windows Server 2012 configurations and Today we will see how to Setup Network IP Address and DNS Server Details using PowerShell in Windows Server 2012.
Configuring Static Network IP Address using PowerShell in Windows Server 2012
Most of the cases we have seen Servers are picking up IP Address from DHCP and as recommended by Microsoft we must setup static IP Address for a Server which is even acting as member server in your organization.
Below command which I am going to share that will allow you to setup static IP Address version 4 (IPv4) on Windows Server 2012 using PowerShell.
PowerShell Command as below
New-NetIPAddress -IPAddress 192.168.30.130 -InterfaceAlias “Ethernet” -DefaultGateway 192.168.30.2 -AddressFamily IPv4 -PrefixLength 24
And once the command is succeeded you will below output
Configure a Network with a New DNS Server IP Address using PowerShell in Windows Server 2012
Once we have configured a static IP Address from the above commands now we should setup a static DNS Server IP Address in our Network Configurations and you just need to run a below command
Set-DnsClientServerAddress -InterfaceAlias “Ethernet” -ServerAddresses 192.168.30.129
This time I am using PowerShell (ISE) which will help you create and save commands in the form of scripts and that you can use it in future just modify few attributes… so it’s very handy….ISE also known as Integrated Scripting Environment of PowerShell.
Here all done Easy Correct – Thanks visiting this web portal…