Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing IP Configurations on a remote machine using Netsh

Status
Not open for further replies.

PhaseK

Technical User
Sep 9, 2003
27
GB
I've found a nice little tool called "Netsh" which allows you change the ip settings for local or remote machines, which is very useful, the ony problem is that it isn't working when trying to change a remote machine. Instead it just changes the local machine!!

This is an outline of what I have tried:

C:\>netsh -r 6gmach01
[g6mach01] netsh>interface ip
[g6mach01] netsh interface ip>set dns name="Local Area Connection" static 10.10.10.10
Ok
[g6mach01] netsh interface ip>quit
C:\>

This in theory should change the dns of g6mach01 to 10.10.10.10 but instead is changing the local dns.

Any ideas please as this would be a great tool if only it worked!!! :)

Karl
 
If you do not have permissions, or the remote access service is not started, the later versions of Netsh.exe (in XP) will give you the notice:

WARNING: Could not obtain host information from machine: xxxxxx. Some commands may not be available.
Access is denied.
 
When executed it does not give any error messages or warnings, but says that the command executed ok, but it has not changed the dns on the remote but on the local.

I will check if ras is running on the machines. I would assume that if i am logged in as administrator I would have the correct rights.

Thanks for the idea, will let you know of any further developments.

Karl
 
I just checked and RAS was not running, i started the service on both machines but it made no difference.

Karl
 
OK, I have tried a couple of different things and I think i am closer, but still having problems:

I have now added \\ to the machine name and it seems to be connecting properly, I can view all the details of the remote machine but when I try and set the DNS i now get the message:

Error obtaining configuration for interface Local Area Connection 4.

Any ideas?

Karl

 
Hello PhaseK,

Also try this with the netsh interface ip prompt:
... interface ip>set address "Local Area Connection" static 10.10.10.10

regards - tsuji
 
Well I'm still not sure why its not running on a remote machine but thanks to the tip from bcastner I have now designed a package to incorporate the psexec command which allows the dns setting to be changed.

Thanks all, I can now stop the pupils from accessing the internet when teachers don't want them to!!

Cheers,
Karl
 
PhaseK,

That is exactly how I did it as well.

Best,
Bill Castner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top