Re: netsh and DHCP server

From: Stephen Fralich (StephenFralich_at_discussions.microsoft.com)
Date: 01/07/05


Date: Fri, 7 Jan 2005 14:43:02 -0800

Unfortunately psexec sends the password as clear text, otherwise it looks good.

"Shenan Stanley" wrote:

> Stephen Fralich wrote:
> > 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.
>
> 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.
>
>
>



Relevant Pages

  • Re: Passing password in ssh
    ... I can picture a cron job that does a backup to a remote machine, or a backup client that uses an ssh link to communicate to a backup server on a remote machine using "unlocked" keys. ... You may want to look into the -r option of bash, ... You can also look into sudo to give limited access to commands that need to be run as root, if what you are doing is going to require it. ... It is designed to be used as the users shell on the remote machine when you want to limit what they can do over a ssh connection. ...
    (Fedora)
  • RE: [Full-Disclosure] Psexec on *NIX
    ... The idea here is that he'd like to run commands on a remote windows box, ... but Psexec requires nothing more than a fresh windows ...
    (Full-Disclosure)
  • Re: exit status of remote commands
    ... I want to execute some commands on a remote machine through ssh and ...
    (comp.lang.perl.misc)
  • Re: remote machine execution
    ... i tried and it only pass the exe over the remote machine without the ... What happens when you execute the command line locally on machine nol-b0000586? ... you use any credentials to run the command via psexec, ... I suspect that the process spawned by psexec on the remote PC needs some network ...
    (microsoft.public.windows.server.scripting)
  • Re: remote machine execution
    ... I use robocopy and copy my files to remote machine directory. ... Seems psexec don't work, or shld i write ...
    (microsoft.public.windows.server.scripting)