We are going through a network redesign and I have 35 Windows 2003/2008 servers at a remote location that I need to change the IP address, gateway and DNS informaiton for.
Ideally I would like to be able to preform this from a command line on my local system (Windows 7) remotly, so I can script out the process to update all systems quickly.
I have looked into netsh, but I'm having problems getting it to change the address remotly. For testing I'm tring to run the following comand which should return the current network config on the remote machine:
netsh -r \\server interface ip show config
However, the following error is returned:
WARNING: Could not obtain host information from machine: [\server]. Some commands may not be available.
The parameter is incorrect.
The following command was not found: interface ip show config.
If I login to the server over RDP I am able to run the command netsh interface ip show config, and I receive the expected results.
This would seem to indicate, as the error is saying, that not all commands and funtions are available from a remote machine as might be available from a local session.
Is there any other method that I can use to accomplish the task of changing the IP address information for these servers remotely?
Would PSTOOLS psexec suffice for this? You can open up a command prompt on a remote machine from your local desktop with:
psexec \\servername -u username -p password cmd
Use the xcmd tool to logon first on the remote machine then execute your netsh command as if you were doing it locally.
If you do not mind to change approach and can use Python, I believe Fabric could be a nice solution for your needs, although I never actually tested it on Windows machines.
HTH.
Maybe you can write a batch (.bat file), upload it, login via RDP and run it?