public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Remotely restart a windows machine
@ 2020-09-25 13:32 Peter J. Krum
  2020-09-25 14:23 ` john doe
  2020-09-25 14:28 ` Peter J. Krum
  0 siblings, 2 replies; 11+ messages in thread
From: Peter J. Krum @ 2020-09-25 13:32 UTC (permalink / raw)
  To: cygwin

I used this command on ubuntu:
net rpc shutdown -r -f -t 30  -I 123.123.123.123 -U user:pass

What would be the equivalent in CYGWIN?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 13:32 Remotely restart a windows machine Peter J. Krum
@ 2020-09-25 14:23 ` john doe
  2020-09-25 14:28 ` Peter J. Krum
  1 sibling, 0 replies; 11+ messages in thread
From: john doe @ 2020-09-25 14:23 UTC (permalink / raw)
  To: cygwin

On 9/25/2020 3:32 PM, Peter J. Krum via Cygwin wrote:
> I used this command on ubuntu:
> net rpc shutdown -r -f -t 30  -I 123.123.123.123 -U user:pass
>
> What would be the equivalent in CYGWIN?
> --

What error/issue are you having?

--
John Doe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 13:32 Remotely restart a windows machine Peter J. Krum
  2020-09-25 14:23 ` john doe
@ 2020-09-25 14:28 ` Peter J. Krum
  2020-09-25 14:36   ` john doe
  2020-09-25 17:45   ` Peter J. Krum
  1 sibling, 2 replies; 11+ messages in thread
From: Peter J. Krum @ 2020-09-25 14:28 UTC (permalink / raw)
  To: cygwin

The syntax of this command is:

NET
    [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
      HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
      STATISTICS | STOP | TIME | USE | USER | VIEW ]

On Fri, Sep 25, 2020 at 9:32 AM Peter J. Krum <peterk2003@gmail.com> wrote:

> I used this command on ubuntu:
> net rpc shutdown -r -f -t 30  -I 123.123.123.123 -U user:pass
>
> What would be the equivalent in CYGWIN?
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 14:28 ` Peter J. Krum
@ 2020-09-25 14:36   ` john doe
  2020-09-25 14:57     ` Eliot Moss
  2020-09-25 17:45   ` Peter J. Krum
  1 sibling, 1 reply; 11+ messages in thread
From: john doe @ 2020-09-25 14:36 UTC (permalink / raw)
  To: cygwin

On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
> The syntax of this command is:
>
> NET
>      [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>        HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>        STATISTICS | STOP | TIME | USE | USER | VIEW ]
>

This is a Windows command, I would look at 'shutdown.exe' or whatever
tools is using rpc to restart windows remotely.

--
John Doe

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 14:36   ` john doe
@ 2020-09-25 14:57     ` Eliot Moss
  2020-09-27 21:45       ` Andrey Repin
  0 siblings, 1 reply; 11+ messages in thread
From: Eliot Moss @ 2020-09-25 14:57 UTC (permalink / raw)
  To: john doe, cygwin

On 9/25/2020 10:36 AM, john doe wrote:
> On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
>> The syntax of this command is:
>>
>> NET
>>      [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>        HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>>        STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>
> 
> This is a Windows command, I would look at 'shutdown.exe' or whatever
> tools is using rpc to restart windows remotely.

shutdown is the program that the OP desires to run remotely.  The question boils down to: How, using 
Cygwin, can I send a remote command to another computer on the network?

If the remote has sshd installed and set up, you could:

ssh user@remote shutdown ...

If you don't, I'm not sure what tools are available.  NET SESSION might be relevant;
it's a Windows thing I have never used.


But I suspect you really want Samba administration tools under Windows.  A little bit
of web search found RSAT (Remote Samba Administration Tools, for Windows).  Maybe that
will help?  If it has command line tools, you can invoke them from Cygwin if they're
on your PATH.

Regards - EM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 14:28 ` Peter J. Krum
  2020-09-25 14:36   ` john doe
@ 2020-09-25 17:45   ` Peter J. Krum
  2020-09-25 17:49     ` Eliot Moss
  1 sibling, 1 reply; 11+ messages in thread
From: Peter J. Krum @ 2020-09-25 17:45 UTC (permalink / raw)
  To: cygwin

Oh OK thanks didn't realize it was calling the windows commands....




On Fri, Sep 25, 2020 at 10:28 AM Peter J. Krum <peterk2003@gmail.com> wrote:

> The syntax of this command is:
>
> NET
>     [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>       HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>       STATISTICS | STOP | TIME | USE | USER | VIEW ]
>
> On Fri, Sep 25, 2020 at 9:32 AM Peter J. Krum <peterk2003@gmail.com>
> wrote:
>
>> I used this command on ubuntu:
>> net rpc shutdown -r -f -t 30  -I 123.123.123.123 -U user:pass
>>
>> What would be the equivalent in CYGWIN?
>>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 17:45   ` Peter J. Krum
@ 2020-09-25 17:49     ` Eliot Moss
  0 siblings, 0 replies; 11+ messages in thread
From: Eliot Moss @ 2020-09-25 17:49 UTC (permalink / raw)
  To: Peter, cygwin; +Cc: Peter J. Krum

On 9/25/2020 1:45 PM, Peter J. Krum via Cygwin wrote:
> Oh OK thanks didn't realize it was calling the windows commands....
> 
> 
> 
> 
> On Fri, Sep 25, 2020 at 10:28 AM Peter J. Krum <peterk2003@gmail.com> wrote:
> 
>> The syntax of this command is:
>>
>> NET
>>      [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>        HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>>        STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>
>> On Fri, Sep 25, 2020 at 9:32 AM Peter J. Krum <peterk2003@gmail.com>
>> wrote:
>>
>>> I used this command on ubuntu:
>>> net rpc shutdown -r -f -t 30  -I 123.123.123.123 -U user:pass
>>>
>>> What would be the equivalent in CYGWIN?

Just to make sure we understand each other ...

"net" on Linux is a Linux command used for managing Samba shares, etc.

"net" on Windows is a Windows program that comes with the OS.  If it's on the user's path under 
Cygwin (normally it would tend to be, I believe), then typing "net" under Cygwin will invoke it. 
But it's quite a different program from the Linux "net"!

Best wishes - EM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-25 14:57     ` Eliot Moss
@ 2020-09-27 21:45       ` Andrey Repin
  2020-09-27 23:24         ` Eliot Moss
  0 siblings, 1 reply; 11+ messages in thread
From: Andrey Repin @ 2020-09-27 21:45 UTC (permalink / raw)
  To: Eliot Moss, cygwin

Greetings, Eliot Moss!

> On 9/25/2020 10:36 AM, john doe wrote:
>> On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
>>> The syntax of this command is:
>>>
>>> NET
>>>      [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>>        HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>>>        STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>>
>> 
>> This is a Windows command, I would look at 'shutdown.exe' or whatever
>> tools is using rpc to restart windows remotely.

> shutdown is the program that the OP desires to run remotely.  The question boils down to: How, using
> Cygwin, can I send a remote command to another computer on the network?

Unsurprisingly, it's `shutdown`…
But you must be an admin on the remote system.

$ shutdown /\?
Usage: C:\Windows\System32\shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
    [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
    /s         Shutdown the computer.
    /r         Shutdown and restart the computer.
    /g         Shutdown and restart the computer. After the system is
               rebooted, restart any registered applications.
    /a         Abort a system shutdown.
               This can only be used during the time-out period.
    /p         Turn off the local computer with no time-out or warning.
               Can be used with /d and /f options.
    /h         Hibernate the local computer.
               Can be used with the /f option.
    /e         Document the reason for an unexpected shutdown of a computer.
    /m \\computer Specify the target computer.
    /t xxx     Set the time-out period before shutdown to xxx seconds.
               The valid range is 0-315360000 (10 years), with a default of 30.
               If the timeout period is greater than 0, the /f parameter is
               implied.
    /c "comment" Comment on the reason for the restart or shutdown.
               Maximum of 512 characters allowed.
    /f         Force running applications to close without forewarning users.
               The /f parameter is implied when a value greater than 0 is
               specified for the /t parameter.
    /d [p|u:]xx:yy  Provide the reason for the restart or shutdown.
               p indicates that the restart or shutdown is planned.
               u indicates that the reason is user defined.
               If neither p nor u is specified the restart or shutdown is
               unplanned.
               xx is the major reason number (positive integer less than 256).
               yy is the minor reason number (positive integer less than 65536).



-- 
With best regards,
Andrey Repin
Monday, September 28, 2020 0:44:46

Sorry for my terrible english...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-27 21:45       ` Andrey Repin
@ 2020-09-27 23:24         ` Eliot Moss
  2020-09-28  4:47           ` Mark Geisert
  0 siblings, 1 reply; 11+ messages in thread
From: Eliot Moss @ 2020-09-27 23:24 UTC (permalink / raw)
  To: cygwin

On 9/27/2020 5:45 PM, Andrey Repin wrote:
> Greetings, Eliot Moss!
> 
>> On 9/25/2020 10:36 AM, john doe wrote:
>>> On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
>>>> The syntax of this command is:
>>>>
>>>> NET
>>>>       [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>>>         HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>>>>         STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>>>
>>>
>>> This is a Windows command, I would look at 'shutdown.exe' or whatever
>>> tools is using rpc to restart windows remotely.
> 
>> shutdown is the program that the OP desires to run remotely.  The question boils down to: How, using
>> Cygwin, can I send a remote command to another computer on the network?
> 
> Unsurprisingly, it's `shutdown`…
> But you must be an admin on the remote system.

Yes, I've used that program.  I think the question is how to invoke it remotely.  Tips about how to 
do that?  :-)

Regards - EM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-27 23:24         ` Eliot Moss
@ 2020-09-28  4:47           ` Mark Geisert
  2020-09-29 15:56             ` Stephen Carrier
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Geisert @ 2020-09-28  4:47 UTC (permalink / raw)
  To: cygwin

Eliot Moss wrote:
> On 9/27/2020 5:45 PM, Andrey Repin wrote:
>> Greetings, Eliot Moss!
>>
>>> On 9/25/2020 10:36 AM, john doe wrote:
>>>> On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
>>>>> The syntax of this command is:
>>>>>
>>>>> NET
>>>>>       [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>>>>         HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
>>>>>         STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>>>>
>>>>
>>>> This is a Windows command, I would look at 'shutdown.exe' or whatever
>>>> tools is using rpc to restart windows remotely.
>>
>>> shutdown is the program that the OP desires to run remotely.  The question 
>>> boils down to: How, using
>>> Cygwin, can I send a remote command to another computer on the network?
>>
>> Unsurprisingly, it's `shutdown`…
>> But you must be an admin on the remote system.
> 
> Yes, I've used that program.  I think the question is how to invoke it remotely.  
> Tips about how to do that?  :-)

It's in the part of Andrey's reply you didn't quote :-)

Usage: C:\Windows\System32\shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | 
/e] [/f]
     [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]
...
     /m \\computer   Specify the target computer.

..mark

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Remotely restart a windows machine
  2020-09-28  4:47           ` Mark Geisert
@ 2020-09-29 15:56             ` Stephen Carrier
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Carrier @ 2020-09-29 15:56 UTC (permalink / raw)
  To: Mark Geisert; +Cc: cygwin

On Sun, Sep 27, 2020 at 09:47:01PM -0700, Mark Geisert wrote:
> Eliot Moss wrote:
> > On 9/27/2020 5:45 PM, Andrey Repin wrote:
> > > Greetings, Eliot Moss!
> > > 
> > > > On 9/25/2020 10:36 AM, john doe wrote:
> > > > > On 9/25/2020 4:28 PM, Peter J. Krum via Cygwin wrote:
> > > > > > The syntax of this command is:
> > > > > > 
> > > > > > NET
> > > > > >       [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
> > > > > >         HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
> > > > > >         STATISTICS | STOP | TIME | USE | USER | VIEW ]
> > > > > > 
> > > > > 
> > > > > This is a Windows command, I would look at 'shutdown.exe' or whatever
> > > > > tools is using rpc to restart windows remotely.
> > > 
> > > > shutdown is the program that the OP desires to run remotely. 
> > > > The question boils down to: How, using
> > > > Cygwin, can I send a remote command to another computer on the network?
> > > 
> > > Unsurprisingly, it's `shutdown`…
> > > But you must be an admin on the remote system.
> > 
> > Yes, I've used that program.  I think the question is how to invoke it
> > remotely.  Tips about how to do that?  :-)
> 
> It's in the part of Andrey's reply you didn't quote :-)
> 
> Usage: C:\Windows\System32\shutdown.exe [/i | /l | /s | /r | /g | /a | /p |
> /h | /e] [/f]
>     [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]
> ...
>     /m \\computer   Specify the target computer.
> 
> ..mark
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Alternatively, you could install sshd on the remote machine for shutting
down (with "shutdown /s" or whatever) and much more besides.

--Stephen Carrier

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-29 15:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 13:32 Remotely restart a windows machine Peter J. Krum
2020-09-25 14:23 ` john doe
2020-09-25 14:28 ` Peter J. Krum
2020-09-25 14:36   ` john doe
2020-09-25 14:57     ` Eliot Moss
2020-09-27 21:45       ` Andrey Repin
2020-09-27 23:24         ` Eliot Moss
2020-09-28  4:47           ` Mark Geisert
2020-09-29 15:56             ` Stephen Carrier
2020-09-25 17:45   ` Peter J. Krum
2020-09-25 17:49     ` Eliot Moss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).