Solved

automatically server restart

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

Accepted Solution

by:
becraig earned 500 total points
Comment Utility
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
Comment Utility
i would like only server RESTART at 03:00am every sundays
0
 

Author Comment

by:apollo-13
Comment Utility
how can i do .cmd datei for restart run
0
 
LVL 28

Expert Comment

by:becraig
Comment Utility
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

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

I have been working as System Administrators since 2003. I recently started working as a FreeLancer and was amazed to find out that very few people are taking full advantage of their Windows Server Machines. Microsoft Windows Server comes with so…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
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 locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

744 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

13 Experts available now in Live!

Get 1:1 Help Now