How to Configure IP Address with PowerShell?

Configure IP Address with PowerShell follow steps below:

1.To change ip address we need to use the “New-NetIPAddress” command

New-NetIPAddress -Ethernet -IPAddress 172.16.171.51 -PrefixLength 24 -DefaultGateway 172.16.171.1

2. To set DNS ip address we need to use the “Set-DNSClientServerAddress“ command:

Set-DnsClientServerAddress -Ethernet  -ServerAddresses 172.16.171.51

3. To look at the result  with “Get-NetIPConfiguration” and “Get-NetAdapter” command. It will shows you IP configurations

1netipcong