How to Change Your IP Address Using PowerShell
http://www.howtogeek.com/wp-content/...4/image477.png
We have already shown you how you can change your IP address from the command prompt, which required long netsh commands, now we are doing the same thing in PowerShell, without the complexity. Note: The following commands are new in PowerShell v3 and therefore require Windows 8, they also require an administrative command prompt. Editors Note: This article is probably for our more geeky audience and requires some basic knowledge of IP Addressing and CIDR notation Changing Your IP Address We have seen people pulling out their hair trying to change their IP addresses using cryptic WMI classes in older versions of PowerShell, but that changed with PowerShell v3, there is now a NetTCPIP module that brings most of the functionality to native PowerShell. While a bit confusing at first, mostly due to the lack of documentation at the moment, it starts to make sense once the geeks shows you how its done. 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. So here it is: New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254This assumes the following:
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.2This 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. Thanks to Geek Taylor Gibb |
All times are GMT. The time now is 00:59. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.5.2