Frag Infinity Tournament, Inc. - FITES LAN Party - www.fites.net

LAN Party Forums => Support Group => Started by: vincegun on March 31, 2013, 06:23:36 PM

Title: Windows Home Server shutdown
Post by: vincegun on March 31, 2013, 06:23:36 PM
Is there any way to shut down WHS without having to go into remote desktop (mstsc.exe) and wait for it to show the desktop for the WHS machine? Like maybe over the command prompt? Or with a simple batch file, like "shutdownserver.bat?"

I know it's not much work at all to wait to click on the start menu in WHS to do what I want, but I'm just curious.
Title: Re: Windows Home Server shutdown
Post by: _!Rathe!_ on April 01, 2013, 08:55:16 AM
use the Shutdown command?  I know this is from 2000 but it should still work.  We use it locally on a 2008 server to have a scheduled reboot over the weekend.

http://support.microsoft.com/kb/317371 (http://support.microsoft.com/kb/317371)
Title: Re: Windows Home Server shutdown
Post by: vincegun on April 01, 2013, 09:49:27 AM
Thanks, I'll give it a shot this weekend.
Title: Re: Windows Home Server shutdown
Post by: sully! on April 01, 2013, 01:09:45 PM
What Rathe said, but with the caveat that it will not work because of account authentication. The account you run the Shutdown command from on your PC will need to have rights to shutdown the WHS. You can accomplish this by going into the "Computer Management" on the WHS and adding your user account to the administrators group (probably don't want to do it this way for broader security reasons) or assigning the "Force shutdown from a remote system" user right to your account. The latter option gives you just what you're looking to accomplish without opening up other things that could have unintended consequences/security concerns.

To do this, on the WHS, go to Start-->Control Panel-->Administrative Tools-->Local Security Policy. In the left pane, expand Local Policies then click User Rights Assignment. In the right pane, find the setting for "Force shutdown from a remote system". Double-click this and then click the "Add User or Group..." button. Add the account you use from your system and hit OK twice. This will now grant your account the right to restart/shutdown the WHS from your client system.

To actually perform the shutdown, open notepad and enter the following:
Code: [Select]
shutdown /r /m \\SERVER /t 0

Replace SERVER with whatever your server name is. Save this file as RestartServer.cmd and that's it. Now you can just run RestartServer.cmd when you want to restart your WHS. If you want to make a shutdown version of this, just change the /r to /s.
Title: Re: Windows Home Server shutdown
Post by: vincegun on April 01, 2013, 03:38:55 PM
sweeeet
Title: Re: Windows Home Server shutdown
Post by: The Nstuff on April 01, 2013, 05:16:15 PM
What sully should get you going while you're on your own network.

If you are referring to WHS v1, and you need/want to restart it away from home (but you have access to a pc/laptop with internet)...

go to your homeserver site (<whs_name.homeserver.com)
login with an admin account
click the computers tab
click the "connect to your home server" link
enter your WHS password
the normal WHS panel should come up
click the settings button (top right)
Shutdown (bottom left of the pop-up)
Shutdown / Restart

Not sure if they changed/moved this functionality within WHS 2011
Title: Re: Windows Home Server shutdown
Post by: _!Rathe!_ on April 02, 2013, 10:42:03 AM
I never liked the fact that they brought the Home Server Console up in remote so I hacked the web interface and changed it so it opens the remote desktop to my server when I click on that link.  Here are the instructions for switching it if you are interested.

http://www.windows-now.com/blogs/dougknox/remote-desktop-access-windows-home-server.aspx (http://www.windows-now.com/blogs/dougknox/remote-desktop-access-windows-home-server.aspx)
Title: Re: Windows Home Server shutdown
Post by: sully! on April 02, 2013, 11:55:57 AM
Yes, but...

shut down WHS without having to go into remote desktop

which is why I didn't mention the the WHS Console, as it is as you mentioned, using RDP to display the console. You're still waiting for the RDP session to initialize, the WHSConsole.exe to launch, etc. It seemed to me like Vince wanted a quick trigger solution to restart/shutdown.
Title: Re: Windows Home Server shutdown
Post by: The Shoctor on April 02, 2013, 01:34:08 PM
Sully wins for reading the whole RFP!
Title: Re: Windows Home Server shutdown
Post by: vincegun on April 06, 2013, 06:06:16 AM
+over9000 for the help. It works exactly as I was hoping it would.