Solved

automatically server restart

Posted on 2014-02-24
4
406 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
  • 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. 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

Suggested Solutions

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

895 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now