Computer NetworksNETWORKS

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

source

ip address

Alice AUSTIN

Alice AUSTIN is studying Cisco Systems Engineering. He has passion with both hardware and software and writes articles and reviews for many IT websites.

Leave a Reply

Your email address will not be published. Required fields are marked *