Solved

automatically server restart

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

828 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