I've had to play with this a bit recently, because I have to convert a whole bunch of PCs from static addressing to DHCP (and vice versa), and would like to throw the following past an expert in such arcane matters.
When converting from static addressing to DHCP, which sequence of commands would you prefer?
netsh interface ipv4 delete dnsservers "Local Area Connection" all
netsh interface ipv4 set address "Local Area Connection" dhcp
or
netsh interface ipv4 set address "Local Area Connection" dhcp
netsh interface ipv4 set dnsservers "Local Area Connection" dhcp
or
?
Adventures with NETSH
-
- PlatinumLounger
- Posts: 5414
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Adventures with NETSH
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- SilverLounger
- Posts: 2072
- Joined: 25 Jan 2010, 02:12
Re: Adventures with NETSH
See How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000. Even though the article says Win2K I can't believe that the procedure would've changed for more modern versions of Windows.
Joe
-
- PlatinumLounger
- Posts: 5414
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Adventures with NETSH
Joe - that's one of the articles I've encountered - but other articles have suggested an additional command - either Delete before, or Set after, so I wondered what network techies would use!
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- Administrator
- Posts: 12618
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Adventures with NETSH
I have done this kind of thing in the past John, but not for a very long time and my memory is not up to the task of recalling those details
StuartR
-
- PlatinumLounger
- Posts: 5414
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Adventures with NETSH
Ah, Stuart - this networking stuff is new to me!
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- SilverLounger
- Posts: 2072
- Joined: 25 Jan 2010, 02:12
Re: Adventures with NETSH
Do you have a couple of machines you can try it on before attempting a whole bunch?
Joe
-
- PlatinumLounger
- Posts: 5414
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Adventures with NETSH
I've tried it on one, using both indicated methods. The only apparent difference is that the Delete command gives a message like "There are no DNS servers assigned" (presumably "now"!).
What I'm not clear on is whether the single Set Address command is the scripted equivalent of going into the Change Adapter Settings GUI window and setting the two radio buttons "Obtain an IP address automatically" and (particularly) "Obtain DNS server address automatically". It looks as though I need to put a
netsh int ipv4 sh con
command after each of the commands in my first post. A job for tomorrow, when I'm at work!
What I'm not clear on is whether the single Set Address command is the scripted equivalent of going into the Change Adapter Settings GUI window and setting the two radio buttons "Obtain an IP address automatically" and (particularly) "Obtain DNS server address automatically". It looks as though I need to put a
netsh int ipv4 sh con
command after each of the commands in my first post. A job for tomorrow, when I'm at work!
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...