Stephen Fralich
2005-01-06 22:51:02 UTC
If you type netsh /?, it says netsh has -u and -p options, username and
password respectively. It also as a -r option to execute netsh commands on a
remote server. Logged in as a non-domain user on a remote machine, I want to
be able to make changes to DHCP. I've tried the following:
netsh -r adserver -u domain\administrator -p password dhcp server show version
netsh -u domain\administrator -p password dhcp server \\adserver show version
Both of these produce:
Unable to determine the DHCP Server version for the Server 192.168.2.2.
Server may not function properly.
No matter what commands you send to the DHCP server, it always returns the
above error.
You can execute both the commands below successfully using runas:
netsh -r adserver dhcp server show version
netsh dhcp server \\adserver show version
I need to execute commands using a script though, so runas won't help. I
found a freeware program called CPAU (runas with password commandline
option), but it doesn't pass errors back through. Even if you have the wrong
password it exits 0 and returns "Command completed successfully."
Any suggestions about how to make netsh work properly remotely? Any other
ideas about how to accomplish what I want would be appreciated as well.
Thanks.
Stephen
password respectively. It also as a -r option to execute netsh commands on a
remote server. Logged in as a non-domain user on a remote machine, I want to
be able to make changes to DHCP. I've tried the following:
netsh -r adserver -u domain\administrator -p password dhcp server show version
netsh -u domain\administrator -p password dhcp server \\adserver show version
Both of these produce:
Unable to determine the DHCP Server version for the Server 192.168.2.2.
Server may not function properly.
No matter what commands you send to the DHCP server, it always returns the
above error.
You can execute both the commands below successfully using runas:
netsh -r adserver dhcp server show version
netsh dhcp server \\adserver show version
I need to execute commands using a script though, so runas won't help. I
found a freeware program called CPAU (runas with password commandline
option), but it doesn't pass errors back through. Even if you have the wrong
password it exits 0 and returns "Command completed successfully."
Any suggestions about how to make netsh work properly remotely? Any other
ideas about how to accomplish what I want would be appreciated as well.
Thanks.
Stephen