Tech Support > Microsoft Windows > Windows Server > Restart a Windows 2003 server via scheduled task without no user is logged on
Restart a Windows 2003 server via scheduled task without no user is logged on
Posted by Stefan Westner on June 10th, 2005


Hello,

I want to restart my windows 2003 server daily at night 1 am. There is
a tool called shutdown but it only works if a user is logged on. That's
not the case. How could I restart the server with no user ist logged on?

Thanks

Stefan Westner

Posted by Dave Patrick on June 10th, 2005


No, shutdown.exe also works from Scheduled Task. Also
http://www.sysinternals.com/Utilities/PsShutdown.html

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Stefan Westner" wrote:
| Hello,
|
| I want to restart my windows 2003 server daily at night 1 am. There is
| a tool called shutdown but it only works if a user is logged on. That's
| not the case. How could I restart the server with no user ist logged on?
|
| Thanks
|
| Stefan Westner


Posted by Torgeir Bakken \(MVP\) on June 10th, 2005


Stefan Westner wrote:


You might need to enable the remote shutdown privilege for the user
account that is defined as the task user even if you are going to only
operate on the local computer. If the task user is a member of the
local Administrators group, I think the privilege is already in place.

Take a look here for how to add remote shutdown privilege:
http://groups.google.co.uk/groups?th...GP09.phx .gbl

Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
suffer under this limitation and is the tool I recommend to use in
this case.

http://www.sysinternals.com

Alternatively, to avoid any 3rd party tool, you can use a VBScript
instead (I don't think it have the same issue as shutdown.exe, but I
am not 100% sure):
http://groups.google.co.uk/group/mic...b?dmode=source


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx

Posted by Stefan Westner on June 11th, 2005


Dave Patrick wrote:

Hello Dave,

I add a scheduled task run as administrator with following command-line:
C:\Scripts\psshutdown.exe -r -t 0

The task is executed but the server doesn't restart if no user is
logged in. If I run the same command with a logged in user all works
fine. Why?

Thanks

Stefan Westner

Posted by Dave Patrick on June 12th, 2005


Scheduled Tasks|Advanced|View Log may provide some details.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Stefan Westner" wrote:
| Hello Dave,
|
| I add a scheduled task run as administrator with following command-line:
| C:\Scripts\psshutdown.exe -r -t 0
|
| The task is executed but the server doesn't restart if no user is
| logged in. If I run the same command with a logged in user all works
| fine. Why?
|
| Thanks
|
| Stefan Westner


Posted by Stefan Westner on June 12th, 2005


That's the log-extract:

"Serverneustart.job" (psshutdown.exe)
Start: 11.06.2005 23:59:00
"Serverneustart.job" (psshutdown.exe)
Ende: 11.06.2005 23:59:00
Ergebnis: Der Task wurde mit folgendem Ergebniswert abgeschlossen: (0).


But the server was not restarted - if I look in the task-manager to see
the idle-time under processes it shows 42 hours and at 8 am it should
show 8 hours if the server was restarted.

Any hints?

Stefan Westner

Dave Patrick wrote:


Posted by Dave Patrick on June 13th, 2005


Sorry but I can't translate that.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Stefan Westner" wrote:
| That's the log-extract:
|
| "Serverneustart.job" (psshutdown.exe)
| Start: 11.06.2005 23:59:00
| "Serverneustart.job" (psshutdown.exe)
| Ende: 11.06.2005 23:59:00
| Ergebnis: Der Task wurde mit folgendem Ergebniswert abgeschlossen: (0).
|
|
| But the server was not restarted - if I look in the task-manager to see
| the idle-time under processes it shows 42 hours and at 8 am it should
| show 8 hours if the server was restarted.
|
| Any hints?
|
| Stefan Westner
|
| Dave Patrick wrote:
|
| > Scheduled Tasks|Advanced|View Log may provide some details.
|


Posted by Stefan Westner on June 13th, 2005


It says that the result of the job was 0 which meens "all fine" but the
server doesn't restart.

Dave Patrick wrote:


Posted by Dave Patrick on June 13th, 2005


That is odd. Any Event Viewer errors?

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Stefan Westner" wrote:
| It says that the result of the job was 0 which meens "all fine" but the
| server doesn't restart.


Posted by Stefan Westner on June 13th, 2005


Dave Patrick wrote:

No, no errors. But the security log shows that at 23:59:00 (the time
where I planned the restart-task) the user administrator (under which
the task is executed) is logged on on the system and this logon worked
fine. But no errors anyway...

Posted by Dave Patrick on June 13th, 2005


See if something here helps you.

http://www.microsoft.com/technet/pro...c165961ec.mspx

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Stefan Westner" wrote:
| No, no errors. But the security log shows that at 23:59:00 (the time
| where I planned the restart-task) the user administrator (under which
| the task is executed) is logged on on the system and this logon worked
| fine. But no errors anyway...