I was away for a few days with my family visiting relatives, but being self-employed it can be hard to take time off, and wouldn’t you know it I had to spend a little time online checking email, finding passwords for people and occasionally just checking in on things at the house through a remote desktop connection to my Windows computer back at home.
The only problem is that after the first night I was not able to connect to the remote desktop. I knew the machine was there, I could SSH into my Linux server and ping the Windows computer but there was no way it would properly connect a remote desktop connection. I had to reboot the Windows machine to see if I could get it back to normal. Thankfully my Linux server uses Samba as well and with a little searching I soon had my answer: http://www.linuxforums.org/forum/ redhat-fedora-linux-help/60324- remote-shutdown-windows-linux-box.html#post573872
net rpc SHUTDOWN -C “some comment here” -f -I x.x.x.x -U user_name%password
I modified it a little bit and came up with this:
net rpc shutdown -r -f -I xxx.xxx.xxx.xxx -U username
I entered my password and a few minutes later guess what I was able to do? I was able to connect to my remote desktop on my Windows machine back at home. Linux saves Windows once again.
Thank you. This idea is usefull for XEN or virtulization environment.
You are welcome. Glad it was helpful. Thanks for the link as well. Appreciate it.
it tells me this :
~/ $: net rpc shutdown -r -f -I 192.168.2.103 -U fam-Udrescu
Password:
[2008/07/01 22:43:56, 0] utils/net_rpc.c:run_rpc_command(160)
Could not initialise pipe \winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND
~/ $:
any idea why?
Sorry don’t know specifically what might be the problem, but it does look like you are giving two user names. Maybe that has something to do with it.
Great. Also a very good way to safe some power during the night. In combination with wakeonlan in the morning, it will save some kw’s per year.
for: A.Faith
The problem you have is probably not related to the “net rpc” command, but to windows local security policy configuration.
See this post at ubuntu forums for details:
http://ubuntuforums.org/showthread.php?p=5592041#post5592041
Regards
Awesome! Worked like a charm.
Unfortunately I get that error, too.
I think it might have something to do with the fact I’m using Vista Home Premium.
I can’t use the DOS shutdown command from my XP command prompt to remotely shut down this Vista PC either. It says access is denied when using the DOS shutdown command.
My guess is that Vista Home Premium denies all remote shutdowns.
It’s alright – I found a fix for it now.
Turns out it was just 1 simple registry addition.
I’ll post the URL where I found the help later – I don’t have it to hand at the moment.
Instead of automatic restart / shutdown XP remotely, is there anyway we ask user input?
let’s say we ask if user click NO within 5 minutes, the shutdown will be aborted
Not that I am aware of. A quick check on my machine shows the following options for net rpc
There is the option to abort a shutdown, but nothing to ask for user input.