Recently, in an advent of troubleshooting a network issue, I had to run around and set a number of static IP’s onto devices. This being said, having to physically get up and run around a touch a number of devices can be a bit tedious.
Given you can get a remote session with each computer, you can issue the following commands using netsh.
Gathering Information
Lets start by getting some information on the current device. To do so, you will want to run the following command.
|
|
The above command should spit out something along the lines of this, depending on how many network interfaces you have available.
|
|
The key thing here to notice is that the DHCP enabled line says no, meaning that the address shown under IP Address is your statically assigned IP.
Manipulating the Network Card
Next, to modify the DHCP enabled value and essentially over write the statically set address, you will want to run the following command.
|
|
Note that the above command contains “Ethernet” for the interface that I am manipulating, but you should use whatever interface you want to modifies name is. For example some computers, it shows up as “Ethernet 2”.
If everything works, running the above command will literally brick your session, booting you from the console. Give it a few seconds, then do a NSLOOKUP or a PING to find the new IP assigned by DHCP, and you should be able to ping it again.
If the device is pingable, then it should be online and good to go.