Scripting remote system ip configuration

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 22 systems that are spread out among 350 systems in one of our
offices. We want to be able to script out the changing of ip addressing on
these 22 systems that have static addresses. Does anyone have any ideals on
how to do so? Anyone ever attempted somthing like this?

Sean
 
I have 22 systems that are spread out among 350 systems in one of
our offices. We want to be able to script out the changing of ip
addressing on these 22 systems that have static addresses. Does
anyone have any ideals on how to do so? Anyone ever attempted
somthing like this?

Sean

I'd assume you'd have to script it using the "netsh" command somewhere
in the script.
Try entering the following line from a command prompt:

netsh interface ip set address /?

HTH,
John
 
Thanx for the reply John. I was looking at "NETSH" being the way i would get
this done, what i cant figure out is how to use it on remote systems?
 
When running the "netsh" command on the remote system i get an access denied
error message. I tried using "runas" with no luck.... here is what the script
looks like;

@echo off

runas /user:na\aaseawil02 /netonly "netsh.exe"

interface -r 10.251.185.87 set address name=" Local Area Connection "
source= static addr= 192.168.1.1 mask= 255.255.255.0 gateway= none

Shutdown /i /l /r /m \\hqp-pc-0854 /t 20


Any ideals?


John Wunderlich said:
Thanx for the reply John. I was looking at "NETSH" being the way i
would get this done, what i cant figure out is how to use it on
remote systems?

Typing in "netsh /?" reveals:
Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [Command | -f ScriptFile]

Just insert your remote machine name after the "-r".

"Microsoft Windows XP - Using Netsh"
<http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx>

HTH,
John
 
When running the "netsh" command on the remote system i get an
access denied error message. I tried using "runas" with no
luck.... here is what the script looks like;

@echo off

runas /user:na\aaseawil02 /netonly "netsh.exe"

interface -r 10.251.185.87 set address name=" Local Area
Connection " source= static addr= 192.168.1.1 mask= 255.255.255.0
gateway= none

Shutdown /i /l /r /m \\hqp-pc-0854 /t 20


Any ideals?

In order for "netsh -r" to work from your machine to change a target
machine, the account that your are logged in locally must match the
credentials of an administrator account on the target machine.

You might want to try the different approach of using "psexec.exe" to
connect to your target machine and then execute the netsh command on
the target machine (without the -r option). The psexec command permits
you to enter username and password credentials. Psexec is part of the
PSTools suite available at:
<http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx>

HTH,
John
 
Back
Top