[Samba] RPCClient - Shutting down a Windows machine from Linux

barsenault at gto.net barsenault at gto.net
Tue Mar 23 18:53:24 GMT 2004


Hello everyone,

As part of a backup routine, my Linux machine wakes a remote Windows
machine using Wake-on-LAN, mounts a share using Samba, and copies the
backup across the network to the Windows machine.  As a final step in
this process, I'd like to shut the Windows machine down.

To accomplish this I am using rpcclient which comes with Samba.  The
funny thing is that rpcclient's shutdown command will only work if a
user is logged into the Windows machine.  My backup routine does not
have an interactive login, so shutdown fails with error code 0x00000015
(??).  I don't understand this, and expect that something is wrong with
the Windows Setup. 

Here is the terminal output for a successful shutdown (user logged in)
where _whinnie_ is the NetBios name of my Windows box:

[root at scootbox root]# rpcclient -A /etc/samba/backup_creds.smb whinnie
rpcclient $> shutdown -t 30
rpcclient $>

Here is the output for an unsuccessful shutdown:

[root at scootbox root]# rpcclient -A /etc/samba/backup_creds.smb whinnie
rpcclient $> shutdown -t 30
result was NT code 0x00000015
rpcclient $>

Any insight is certainly appreciated.

Brian


More information about the samba mailing list