Перезагрузка по расписанию windows server 2003

Blog.jpg

Blog

The Internet Innovations Group website blog is a collection of management or technical insight gained from daily consulting or support calls with our clients.

It is not uncommon for a server to require a reboot after a Windows Update, virus protection install, backup software install, or pretty much any third party software that runs as a service.  However, most businesses prefer any Network downtime to occur after hours.

 

Most businesses prefer any Network downtime to occur after hours.

Accordingly, the solution is to schedule an unattended server reboot.  Following are the steps to perform an unattended and scheduled reboot of a Windows 2003 Server.

Before you proceed, some things to consider: 

  • Make sure you have previously performed a manual reboot and know for a fact that the server will reboot successfully without requiring user interaction to complete it’s reboot. Make sure your server doesn’t have BIOS prompts that require you to press F1 or similar to continue.  Make sure, you don’t have any failed Services at start-up that require a manual start.
  • Make sure there are no Scheduled Tasks or other schedule processes that run at the time when you plan to schedule the reboot.

Summary

  1. Create batch file containing the commands to reboot the server
  2. Create a Scheduled Task to execute the batch file

Step by step:

Create Batch File

  1. Open Notepad
  2. Type a line with the following: shutdown -r -f -t 30
  3. Select Save As from the File menu and change the extension from .TXT to .BAT. Place file on local server hard drive (remember location).  The location must be accessible via the User Account whose permission you will use of the Scheduled Task.

Create Scheduled Task

  1. Schedule Batch file as Scheduled Task via Control Panel.
  2.  Browse for previously created Batch file.
  3. Select appropriate Administrator account to execute Scheduled task.
  4. IMPORTANT: Schedule task to run «once», unless you want to be rebooting server on a regular basis daily, weekly, monthly, etc. 

Sample Scheduled Task Entry

Sample Scheduled Task Schedule Tab

Sample Scheduled Task Permissions

We hope our insight has been helpful.  This is just one of many common IT issues we handle on a daily basis as part of our Network, Server, and Desktop support; or it may be insight resulting from our Website, Mobile App, or Database development projects.

If you would like to take advantage of our insight for your daily IT Support and IT Projects, please feel free to contact us.

Click for Contact Information

Internet Innovations Group

Internet and Network Integration Services

Pennsylvania based business providing Internet and Network Integration Services to Small and Midsize businesses.  Services include Website Design, Mobile Device Enabled Websites, Microsoft Servers Support, Router and Wireless Configurations.  Specializing in Squarespace Hosted Websites.

P. 570.267.4671

F. ​866.877.4284

​e. info@internetinnovationsgroup.com

i. www.internetinnovationsgroup.com

Internet Innovations Group | , Clarks Summit, PA 18411, USA

Windows · September 28, 2024


Windows Server 2003, despite being an older operating system, is still utilized in various environments due to its stability and reliability. One of the essential maintenance tasks for any server is ensuring that it runs optimally, which often includes scheduled restarts. This article will guide you through setting up a scheduled automatic restart command using the Task Scheduler in Windows Server 2003.

Understanding the Importance of Scheduled Restarts

Scheduled restarts can help in several ways:

  • Memory Management: Over time, applications can consume more memory, leading to performance degradation. A restart can free up memory and improve performance.
  • Updates and Patches: Regular restarts ensure that updates and patches are applied effectively, reducing vulnerabilities.
  • System Stability: Restarting the server can help clear temporary files and processes that may cause instability.

Setting Up Task Scheduler

To create a scheduled task for restarting your Windows Server 2003, follow these steps:

Step 1: Open Task Scheduler

1. Click on the Start menu.

2. Navigate to Control Panel and then Scheduled Tasks.

3. In the Scheduled Tasks window, click on Add Scheduled Task.

Step 2: Create a New Task

1. The Scheduled Task Wizard will open. Click Next.

2. Choose Other Program and click Browse.

3. Navigate to C:WindowsSystem32shutdown.exe and select it.

4. Click Next.

Step 3: Configure the Task

1. Set the task name (e.g., “Scheduled Restart”).

2. Choose how often you want the restart to occur (Daily, Weekly, etc.).

3. Set the time for the restart. Ensure that this time is during off-peak hours to minimize disruption.

4. Click Next.

Step 4: Set the Command Parameters

1. In the command line parameters field, enter:

/r /t 0

This command tells the system to restart immediately without a delay.

Step 5: Finish the Setup

1. Review your settings and click Finish.

2. You may be prompted to enter the user account credentials that have permission to execute the task. Ensure that this account has the necessary privileges.

Testing the Scheduled Task

After setting up the scheduled task, it is crucial to test it to ensure it works as expected:

  • Manually run the task by right-clicking on it in the Task Scheduler and selecting Run.
  • Check the Event Viewer for any errors related to the task execution.

Best Practices

When implementing scheduled restarts, consider the following best practices:

  • Notify Users: Inform users about the scheduled restart to avoid data loss.
  • Backup Data: Always ensure that critical data is backed up before performing scheduled restarts.
  • Monitor Performance: After implementing scheduled restarts, monitor the server’s performance to assess the impact.

Conclusion

Setting up a scheduled automatic restart command in Windows Server 2003 using Task Scheduler is a straightforward process that can significantly enhance system performance and stability. By following the steps outlined above, administrators can ensure that their servers remain in optimal condition, reducing downtime and improving user experience.

For those looking for reliable server solutions, consider exploring USA VPS Hosting options that can provide robust performance and support for your server needs.

How to schedule a Windows 98/2000/XP/2003 Computer to reboot.

This tutorial will show you how to schedule your PC to reboot at a given time and date, using the utility provided. This tutorial will work with Windows Server 2003, Windows XP, Windows 2000, and Windows 98. For this tutorial I will be using windows XP.

First Schedule Windows to Automatically Restart Download. Save it to disk and extract shutdown.exe to your C:\ drive.

Now open the Control Panel by clicking Start > Control Panel

In the Control Panel double click the Schedules Tasks (May be labeled Task Scheduler in other versions of windows) icon .

The Scheduled Tasks window should open up. Select Add Scheduled Task

This scheduled task wizard should open. Click next on the first screen.

Schedule Windows to Automatically Restart

Click browse and locate the shutdown.exe program. Select shutdown.exe and click open.

Schedule Windows to Automatically Restart

Select how often you would like to perform the task. I want my computer restart Weekly on Sunday morning, so I selected weekly. Make your select and click the next button.

Schedule Windows to Automatically Restart

Now select the time and the days of the week and click next. I selected 2am on every Monday.

Schedule Windows to Automatically Restart

On the next screen you will have to enter your password for windows. You must have a login password for these batch jobs to run. If you do not have a password you will need to add one in user settings. Enter your password information and click next.

Schedule Windows to Automatically Restart

On the final screen, put a checkmark the box that says “Open advanced properties for this task when I click Finish” and then click finish

Schedule Windows to Automatically Restart

Now we will see the advanced properties window.

Schedule Windows to Automatically Restart

Now we have to add a few arguments to the command in the run line. Add the –r –f –t 01 arguments to the line that exists in the run field. My line reads: “C:\SHUTDOWN.EXE –r –f –t 01”.

Schedule Windows to Automatically Restart

Then click apply and the task will be scheduled. You can check later in the task scheduler to see if the task ran successfully.

To avoid restarting server during working hours you easily schedule restart to be performed at night. Obviously the same can be applied to a workstation rather than server.

Create a text file restart.txt with text:
shutdown /r /c “Your message displayed before restart”
If you want to shut down instead of restart, use this text instead:
shutdown /s /c “Your message displayed before shut down”
Rename the file to restart.bat

a. For Windows Server 2003 and Windows XP

Start > Programs > Accessories > System Tools > Scheduled Tasks
Add a new Scheduled task
In Task Tab > Browse > select your restart.bat file
In Schedule Tab > Schedule Task > select Once and set the restart date and time

b. For Windows Server 2008 and Windows 7

Start > All Programs > Accessories > System Tools > Task Scheduler > Task Scheduler Library
Create Basic Task
Name: Restart
Trigger: One Time, select Date and Time
Action: Start a program – select your restart.bat file
Finish

When restart is initiated and message is displayed you have 30 seconds to cancel the restart:
Start > Run >cmd
shutdown -a

Windows Server 2003
Windows Server 2008
Windows XP
Windows 7

.

There is always one application…yes one application that you use all the time, and can’t afford to have it down for one minute during the day.

This same application is buggy and always has problems if it keeps running day after day. You need to reboot once in a while. Yes, and this means you need to stay late and wait until everyone leaves…and then reboot.

There is a simple solution to the problem…the shutdown command in windows 2003. It can shutdown or reboot your system from the command line, and will even allow you to specify reason codes for the shutdown. Here is the lowdown on its possible options:

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c “comment”] [-d up:xx:yy]


No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c “comment” Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)


So, if I wanted to shutdown the machine at a specified time I could create a script with the following:

shutdown -r -f -c “Shutdown to refresh buggy program”

The -f makes sure no application can keep the shutdown from happening, and the -c allows me to add a comment in the event log. The -r tells it to reboot.

Now I have saved this as RebootDaily.bat (Under the windows folder)

Lets schedule it to run daily at 3am. Open the control panel and double click on the “Scheduled Tasks”, and browse for the batch file that we just saved.

Schedule Reboot Daily

Click next, and set the time you want the reboot to start. If you have any backup jobs I would make sure the job time is far from your reboot.

Schedule Reboot 3AM

Click next and set the user account that will be used for the reboot. I suggest setting up a separate account with specific permissions for this task. That way you can slightly relax your password change policy – and lock it down so it can’t do much but reboot the system. Otherwise you will need to make sure you update this task each time the administrator password is changed.

Schedule Reboot Password

Click next, and then finish. Your reboot has been scheduled. Just makes sure it works by manually running it once.

Now your buggy application can get a fresh start every day.

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как отключить антивирус если его нет windows 10
  • Msi shell установка windows
  • Что означает зеленая галочка на ярлыках windows 10
  • Формат mkv чем открыть на windows
  • Приложение для скачивания приложений на ноутбук windows