How to Set the IP Address using PowerShell
This video will help you to set IP Address using Powershell
Script
———————————————————————————————————–
$IPAddr= Read-Host “Enter the IP Address”
$DefaultGateway= Read-Host “Enter the Default Gateway”
$Subnet= Read-Host “Enter the Subnet”
$Networkadapter = (Get-NetAdapter).ifIndex
$DNS1= Read-Host “Enter the Primary DNS IP Address”
$DNS2= Read-Host “Enter the Secondary DNS IP Address”
New-NetIPAddress –IPAddress $IPAddr -DefaultGateway $DefaultGateway -PrefixLength $Subnet -InterfaceIndex (Get-NetAdapter).InterfaceIndex
Set-DNSClientServerAddress –InterfaceIndex $Networkadapter –ServerAddresses $DNS1,$DNS2
ip address