Discussion:
netsh and DHCP server
(too old to reply)
Stephen Fralich
2005-01-06 22:51:02 UTC
Permalink
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
SubnetJO
2005-01-07 17:15:05 UTC
Permalink
Try using the SU command instead "runas".
RUnas work "online" only.

SU command is available after installed the "suss service" shipped with thw
windows resource kit.
The SU command works in "batch mode", and has a graphical interface, if you
want.

WARNING!
The SUSS shipped with the windows2000 server reskit has a bug recognized by
Microsoft.
If you want the fixed versione you have to contat MIcrosoft support (but you
must have subscribed a support contract).

Have a good luck!

I hope this can help.
Bye,
SubnetJO
Italy
Shenan Stanley
2005-01-07 19:19:45 UTC
Permalink
Post by Stephen Fralich
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
netsh -r adserver -u domain\administrator -p password dhcp server
show version netsh -u domain\administrator -p password dhcp server
\\adserver show version
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.
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.
PSEXEC from sysinternals.
--
<- Shenan ->
--
The information is provided "as is", it is suggested you research for
yourself before you take any advice - you are the one ultimately
responsible for your actions/problems/solutions. Know what you are
getting into before you jump in with both feet.
Stephen Fralich
2005-01-07 22:43:02 UTC
Permalink
Unfortunately psexec sends the password as clear text, otherwise it looks good.
Post by Shenan Stanley
Post by Stephen Fralich
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
netsh -r adserver -u domain\administrator -p password dhcp server
show version netsh -u domain\administrator -p password dhcp server
\\adserver show version
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.
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.
PSEXEC from sysinternals.
--
<- Shenan ->
--
The information is provided "as is", it is suggested you research for
yourself before you take any advice - you are the one ultimately
responsible for your actions/problems/solutions. Know what you are
getting into before you jump in with both feet.
Continue reading on narkive:
Loading...