Solved

automatically server restart

Posted on 2014-02-24
4
415 Views
Last Modified: 2014-02-25
I have windows 2008 with mssql 2008.
I would like to server restart every sunday at 03:00 automatically.

can some one show me with ste guiede how can i do that?
0
Comment
Question by:apollo-13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 39884881
Open the Scheduled Task 
START ->All Programs ->Accessorier -> System Tools -> Scheduled Tasks

2Create a new task

Double Click on the "Add a New Scheduled Task"

3Follow the Scheduled Task Wizard

Click "Next"

4Select the program to run

Click on Browse to select the proper program and location to run. Navigate to "C:\WINDOWS\System32\shutdown.exe"

5Select the Frequency

This is where you set how often you want to "task" to exicute. So if you wanted your server to reboot weekly you select "weekly"

6Select the time and day you want the task to start.

This can be once a week at 3 AM or every Wednesady and Friday nights.

7Enter the username and password for a user

This is the user that the scheduled task will run as. I suggest using an account that has domain admin privileges.

8You have successfuly scheduled the following task

At this point you would be done, if you wanted the server to shutdown at the scheduled time. We are going to select the Open Advanced options when I click finished. Then click Finish

9Advanced Options

In the Run option you will see the location of the shutdown program. we are going to add some options.

-r This wil have ther server shutdown and then restart 
-f This will force the server to force any running application to close 
-t 01 This is a time-out before shutdown.

so the full run command is: 
C:\WINDOWS\system32\shutdown.exe -r -f -t 01

Select Apply




I would be careful about any jobs etc that might be running around the time I set for reboot.  
Use /f /r with the shutdown command for force and reboot
0
 

Author Comment

by:apollo-13
ID: 39884889
i would like only server RESTART at 03:00am every sundays
0
 

Author Comment

by:apollo-13
ID: 39884892
how can i do .cmd datei for restart run
0
 
LVL 29

Expert Comment

by:becraig
ID: 39884899
schtasks /Create /TN Shutdown /SC WEEKLY /MO /D SUN /ST 03:00 /TR "shutdown -r -f"

That would schedule it


A simple cmd you could call would be
Shutdown /r /f

You could then call that cmd file
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked if I could set up a fax machine so that incoming faxes were delivered to people's Exchange inboxes and so that they could send faxes from their desktops without needing to print the document first.  I knew it was possible but I had no id…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question