|Don't ask to ask, just ask|
Win32 Detect Active Nic and change IPby Marza (Vicar)
|on Aug 26, 2009 at 21:11 UTC||Need Help??|
Marza has asked for the wisdom of the Perl Monks concerning the following question:
I have been tasked with re-iping a data center for a move. You would think we should use dhcp but that is another story.
I have been looking at tieregistry but there are issues. Many machines have multiple nics(physical and virtual), some people changed the name "Local Area Connection" to something else.
There is the batch file approach but they don't want to install things.
Netsh can do the job but I have never been able to get the -r option to work. Keep getting unknown commands. psexec feeding the command will work but since it's a new ip range, it hangs the computer which means a 5 minute timeout.
Anybody know of a way to detect the active NIC? Once that is identified; it would be possible to locate the GUID entry in the registry and make the appropriate changes.
So far not much luck in my searching.
Right now I am considering taskscheduler with netsh and a shutdown command.Thanks!