Because of a change in networking equipment I might need to set a bunch of machines NICs back to auto negotiate. What's the best way to automate this? I'm thinking an Autoit compiled exe pushed out through group policy or SCCM. Please post your script if you have an example. I'm not sure that all the systems I'm hitting will have the same NICs so something that would reset all known cards to auto would be great.
Thanks! -Mathew
Here's a script to do what you're looking for. You're going to need to do some "homework" to get it to work, though:
You will need to locate the "DriverDesc" value for each kind of NIC you're going to want to change. (Look in the registry under the REG_DEVICE_PATH at each of the subkeys there to find the various DriverDesc values). I've included instructions for a Broadcom 57xx controller in the script. You will need to identify the registry value name and value setting for each kind of NIC and then add entries like those on lines 11-15 for each kind of NIC.
This runs against the local computer right now. It wouldn't be too hard to make it take the computer name on the command-line and run against remote computers. Alternatively, you can just run it locally on each machine.
You will need to reboot the machine after the script runs for the change to take effect. If you're running this on Windows Vista or Windows 7 be aware that it must run in an "Elevated" context. (It was developed on Windows 7 and works fine on Windows XP...)
That should fix you up.
I haven't done anything like this in some time, but I believe that the method for changing this will vary by each NIC card, and possibly by each version of the NIC driver.
IMO the best way to handle it would be to make the change in the registry. If you have less than a dozen models of PC its is probably not that hard, otherwise, uck.
Probably the best option is WMI scripting.
Here's an example to get you started, it reads the network card information. Setting them for a remote computer is easy - change the computername variable to an array, loop through them, and call the set method instead of get.
There's a few examples of WMI scripts on serverfault already.
I'll go against the flow here and suggest that you make the changes by hand. Pre-configure the new device to be the same fubar settings as the old (100/full or whatever) then go through and reset the network device and the computers one at a time. It's a huge obnoxious job, but it is better to make sure everything comes up, and you only have to do it once.
To err is human, to really botch things up requires a script.