1 / 5

how to Change Your IP Address Using PowerShell

Changing an IP Address can be done using the New-NetIPAddress cmdlet, it has a lot of parameters, some of which, are not even documented in Get-Help. CS101 Assignment: Zaman University Phnom Penh Cambodia

guest43783
Download Presentation

how to Change Your IP Address Using PowerShell

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. how to Change Your IP Address Using PowerShell

  2. Changing an IP Address can be done using the New-NetIPAddresscmdlet, it has a lot of parameters, some of which, are not even documented in Get-Help.

  3. So here it is: New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254 • This assumes the following: • The name of the interface you want to change the IP address  for is Local Area Network • You want to statically assign an IP address of 192.168.0.1 • You want to set a subnet mask of 255.255.255.0 (which is /24 in CIDR notation) • You want to set a default gateway of 192.168.0.254 • You would obviously switch the settings out for some that match the addressing criteria for your network.

  4. Setting Your DNS Information Now here comes another tricky part, it turns out that there is a whole separate module called DNSClient that you have to use to manipulate your DNS Settings. To change your DNS Server you would use: Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2

  5. This assumes that you want to set the primary DNS server for Wired Ethernet Connection to 192.168.0.1 and the secondary DNS server to 192.168.0.2. That’s all there is to it.

More Related