Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 3 down vote accepted

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

share|improve this answer
    
I have tested this solution and it appears to work. The only downside is thre is a bit of a delay becuase PSEXEC loses it's connection to the remote system becuase the IP address is changed. This is not a real problem, it just means that the execution for each command takes about 20 seconds instead of the 1 or 2 scond normal time. –  Richard West Nov 29 '09 at 15:30
    
For others, I'm using NETSH in the "cmd" section of the psexec process to preform the IP address change. I then start two addtional psexec tasks to set the DNS servers. –  Richard West Nov 29 '09 at 15:32

Use the xcmd tool to logon first on the remote machine then execute your netsh command as if you were doing it locally.

xCmd.exe \\remoteserver /user:Administrator /pwd:* netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric
share|improve this answer

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.

share|improve this answer

Maybe you can write a batch (.bat file), upload it, login via RDP and run it?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.