Планировщик задач в windows server 2019

These instructions show step by step how to run scheduled tasks in Windows Server 2019 based on Daily, Weekly, Monthly, or another event.

You can schedule tasks on Windows Server to run a specific thing or script at a given time, once or repeatedly.

This is achieved as follows:

Step 1

Right-click on the start menu and select “Computer Management.”

Step 2

On the left-hand menu, right-click on ‘Task Scheduler’ and select “Create basic task.”

Step 3

Give the task a name and a detailed description of what it does.

Step 4

Please select when you want it to run. The options are Daily, Weekly, Monthly, Once When the computer starts when a user logs in or when a specific event is detected in the event log.

Step 5

Assuming Daily, click next and then set a time and a start date, then you can pick the recurrence. You can now tune this despite selecting daily, so it only runs every three days, for example. Click Next once you have made your selection.

Step 5

Your choices now are: Start a program (can also be a script, batch file etc.), Send an email, or display a message on the screen. Make your selection and click Next.

Step 7

Assuming you selected to start a program, you now browse to that program or script, add any arguments it may require, and click next, then finish.

Now while still in computer management, looking at the left-hand menu, under ‘System Tools’ expand ‘Task Scheduler’. Then click on ‘Task Scheduler Library’ you will see your scheduled task in the list with the trigger events in the list. You can edit this at any time.

You can also set the task to run as a specific user under the ‘Security Options’ when viewing the task.

Add a sub network interface or additional IP address in Windows ServerRecovering accidentally deleted partitions Linux & Windows

Task Scheduler enables you to automatically perform routine tasks on a chosen computer. Task Scheduler does this by monitoring whatever criteria you choose (referred to as triggers) and then executing the tasks when those criteria are met. You can use the Task Scheduler to execute tasks such as starting an application, sending an email message, etc. Tasks can be scheduled to execute in response to these events, or triggers. On how to create a Scheduled task with Windows Admin Center, how to setup Windows server backup and create backup jobs, and how to create Windows Task Scheduler via the command prompt. 

To perform these steps via the task scheduler, follow the steps below. Ensure you have your script ready and saved with .ps1 extension. 
- Search and launch the Task Scheduler Tool as shown below or

From the Start menu, select Administrative Tools and then Task Scheduler.

This will open up the task scheduler Tool
– Right-click on Task Scheduler or “under Actions”
– Select “Create Task”

This will open up the create task dialog window as shown below.
– On the General Tab, Enter the Task Name
– Enter a description for others to understand what you are doing
– Select “Run whether user is logged on or not”
If this is not selected and the first option is used, the script may not run when a user does not login. We have had a similar issue in the past.
– Ensure to run with the highest privilege (Here you have to evaluate your security need)

Note: If you are using an account with administrative privileges, the default user should be fine. If you are running a Command Prompt or PowerShell command, you can select the Run whether user is logged on or not option to prevent the command window from showing up when the task runs automatically.
- If the task requires elevated privileges, check the Run with highest privileges option.

Navigate to the Trigger Tab as shown below
– Click on New, This will open a window where the trigger can be defined.

Since we are defining this task for Windows update, and maintenance are done just one in a Month, I will perform the following highlighted in red.

You can decide to have the updates installed on a particular day.
– By selecting the Days and from the dropdown menu, you can select a date. When you are done creating the trigger, The following configured trigger will be displayed as shown below

Next. click on the Action tab

This will open a new Action tab as shown below
– Under the “Settings” section, in the “Program/script” field, specify the path for the application (Here you will have to select the script by browsing to the location or copy the script path to this field).
– Optionally enter the “PowerShell.exe” program path needed to run your script. When this is not select, your script cannot run.

Note: If you don't know the path of the app, click the Browse button to find it. Also, if it is a known application like PowerShell or Command Prompt, all you need to do is to specify the file name.
Note: Use the "Action" drop-down menu and select the Start a program option.You can still use the Send an e-mail or Display a message option, but these are deprecated features, which means that they may or may not work because Microsoft is no longer maintaining them.
- In the "Add arguments" field, you can specify arguments to run the task with special instructions. E.g., -NoExit -ExecutionPolicy Bypass C:PATHTOSCRIPTfirst_script.ps1.
Using the "powershell.exe" command and the above argument, it'll run the script named "first_script.ps1." The argument "-ExecutionPolicy Bypass" ensures that the script runs successfully, and the "-NoExit" argument will prevent the window from closing after running the script.

When this step is complete, it will appear as shown below

Note: You can also edit the Action after it has been created etc.

Next, click on the condition tab as shown above.
– For me, these settings are not applicable, but below is a screenshot of how it looks like 🙂

Also, on the settings tab, all needed

This will prompt you to enter your password as shown below

To view the configured task, click on the “Task Scheduler Library” and
– Search for your configured task on the left pane of the Window.

To test this task, since the date we have configured this task to run is still in the future, we will manually run the task as shown below.
– For more information on how to run, edit, and delete a task using Task Scheduler GUI (taskschd.msc), see the following link.
– Right-click on the task and
– Click on run

In this same manner, the task can be disabled or also from the Actions pane
– Now that you have selected to run your scheduled task, the status will change to running as shown below.
– With the F5 button on your keyboard, you can use this to refresh the states

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

sfc/scannow — проверил?
Dism/online/cleanup-image/restorehealth — Выполнил?

taskschd.msc «Вручную» с консоли «Под Админом» запускается?

Добавлено через 4 минуты
2019-12-18 07:17:35, Info CSI 000037f2 Warning: Overlap: Duplicate ownership for directory ??C:WindowsTasks in component Microsoft-Windows-TaskScheduler-Compatibility, version 10.0.17763.1, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}

2019-12-18 18:08:55, Info CSI 00003899 Warning: Overlap: Duplicate ownership for directory ??C:WindowsTasks in component Microsoft-Windows-TaskScheduler-Compatibility, version 10.0.17763.1, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}

2019-12-18 19:36:04, Info CSI 000048d2 Hashes for file member [l:18]’Task Scheduler.lnk’ do not match.

2019-12-18 19:36:04, Info CSI 000048d3 [SR] Cannot repair member file [l:18]’Task Scheduler.lnk’ of TaskSchedulerSettings, version 10.0.17763.1, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35} in the store, hash mismatch

2019-12-18 19:36:07, Info CSI 00004937 [SR] Could not reproject corrupted file ??C:ProgramDataMicrosoftWindowsStart MenuProgramsAdministrative Tools\Task Scheduler.lnk; source file in store is also corrupted

2020-01-23 09:59:54, Info CBS Repr: Add missing payload:amd64_taskschedulersettings_31bf3856ad364e 35_10.0.17763.1_none_3bb0edaf5c865082Task Scheduler.lnk

У тебя тут целый «букет»…

  • Remove From My Forums
  • Вопрос

  • Windows Server 2019 Standatr, домен.

    Создаю задачу на запуск внешней программы. Повторение ежедневное. Повторять каждые 5 минут бесконечно. Задача с наивысшими правами вне зависимости от входа пользователя. Учетка доменная. UAC отключен совсем.

    Если я указываю время начала выполнения задачи будущим временем — задача выполняется без ошибок однократно и повторов не происходит! Планировщик каждые 5 минут меняет дату следующего запуска программы на 5
    минут в будущее но задачу не запускает. Время прошлого запуска не изменяется, в логах задачи пусто — т.е. вообще ничего не происходит!

    SCHTASKS /Query /v /fo list /TN  SMSEmailSender 

    Папка:
    Имя узла:                                            SRVTS
    Имя задачи:                                          SMSEmailSender
    Время следующего запуска:                            21.10.2019 13:55:00
    Состояние:                                           Готово
    Режим входа в систему:                               Интерактивный/фоновый
    Время прошлого запуска:                              21.10.2019 13:30:00
    Прошлый результат:                                   0
    Автор:                                               TAv.sokolov
    Задача для выполнения:                               «C:Program Files (x86)Microsoft OfficeOffice14MSACCESS.EXE» «D:Папка админовИсходникиSMSEmailSenderSMSEmailSender.accde»
    /X runSend
    Рабочая папка:                                       Н/Д
    Примечание:                                          Н/Д
    Состояние назначенной задачи:                        Включено
    Время простоя:                                       Отключено
    Управление электропитанием:                          Останавливать при питании от батареи
    Запуск от имени:                                     v.sokolov
    Удалить задачу, если она не перенесена:              Отключено
    Остановить задачу, если она выполняется X ч и X мин: Отключено
    Расписание:                                          Планирование данных в этом формате недоступно.
    Тип расписания:                                      Ежедневно 
    Время начала:                                        13:30:00
    Дата начала:                                         21.10.2019
    Дата окончания:                                      N/A
    дн.:                                                 Каждые 1 дн.
    мес.:                                                N/A
    Повторять: каждые:                                   0 ч, 5 мин
    Повторять: до: время:                                Нет
    Повторять: в течение: длительность:                  Отключено
    Повторять: остановить, если выполняется:             Отключено

    Что за колдунство?

Ответы

  • 1. Попробуйте поменять «ежедневно» на «однократно» и оставить «повторять каждые 10 мин».

    2. Попробуйте использовать другую УЗ для данной задачи (не вашу личную), а например сервисную с правами log as batch и неистекаемым паролем.

    • Помечено в качестве ответа

      22 октября 2019 г. 8:41

This blog has detailed how to schedule Windows Server Reboot Automatically (Windows or Server 2008/2019). You may want to reboot a Windows Server once a week or month as a matter of routine maintenance. It’s particularly useful too. Say if you want to reboot a server because you installed particular software that you didn’t expect needed a restart, or there are some updates. You cannot really do it unless after hours and you don’t need to hang around and then you would just like it to reboot itself a couple of hours after working hours when everyone left.

Note: I’m using Windows Server 2019. This is almost the same as in 2008/2012/0216.

Schedule Windows Server Reboot Automatically

1- Select search bar and type Task Scheduler, click on it to open. You can find it by clicking on the Windows start button, expand Windows Administrator Tools, open Control Panel to select Administrative Tools.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

2- Create a new basic task using the Create Task action.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

3- Type a name to the task. I renamed it Restart Server or (Restart This Server). Type a description Schedule Windows Server for Automatically restart. Click next

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

4- Since this task is to just restart the server one time (select one time) and then click next.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

5- Provide it a date and time to restart. Click next.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

6- Select Start A Program action and then click Next.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

7- Type shutdown into the Program/Script box and then /r into the Add arguments box. Click Next.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

8- Click Finish.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

9- We are almost done if you want this to run if you get logged off and you want to set this up so you can use it again later. In the Task Scheduler right-click on your new task and then select Properties.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

10- This will show up on the general settings page. The default settings are “Run only when the user is logged on” switch it to “Run whether the user is logged on or not”. Choose configure to select the Server you want to reboot.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

11- Select ok, after typing your administrator password.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

Changing the Schedule for The Automatic Reboot

So now we have a task that will automatically reboot our Windows server (Computer, PC) one time.

12- Go back to the Task Scheduler Window, right-click on the task and then click Properties. Select the Triggers tab.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

13- Select the One Time trigger and then click the Edit button. Change the time and date, click ok and your server/PC/computer will now restart at the new time.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

14- When you click ok it will ask you to re-enter the administrator password.

Schedule Windows Server Reboot Automatically, How to Schedule Windows Server Reboot Automatically

Watch Video: How to schedule Windows Server reboot automatically.

How to schedule Windows Server reboot automatically
  • Remove From My Forums
  • Question

  • We’re using a physical installation of Windows Server 2019 Standard at a French location. The server is working normally. Task Scheduler is used for a small number of tasks. One of the tasks is supposed to repeat every half hour. The task indeed starts every
    half hour but it runs four times in succession. I have attached screen prints of the task trigger screen and the task history. Why does Event ID 100 (Task started) appear four times at 08:58:01?

Answers

  • I created a task that runs a .CMD-file that launched DIR C:. Since CMD.EXE was never explicitly called, the /C parameter was not needed. The task was configured to run every 15 min and that’s exactly what it did. The task never repeated.

    Interestingly, the original task was left running, also configured to run every 15 min. That’s exactly what it did as well. There were no repeats.

    What changed? To solve a separate problem in Task Scheduler with a different task (see my post

    here, I modified the following GPO:

    Configuration ordinateur | Stratégies | Paramètres Windows | Paramètres de sécurité | Stratégies locales | Options de sécurité | Accès réseau : ne pas autoriser le stockage de mots de passe et d’informations d’identification pour l’authentification du réseau

    Initially, I Defined and Enabled the setting, which proved disastrous. Then I Disabled the setting, but left it Defined.

    Did that have an effect on this task? Maybe not, but I’m done testing Task Scheduler for now.

    Thanks again for your suggestions.

    regards, AndyA

    • Edited by

      Thursday, June 18, 2020 3:29 PM

    • Proposed as answer by
      sylvia_chenMicrosoft contingent staff
      Friday, June 19, 2020 7:07 AM
    • Marked as answer by
      AAronoff
      Friday, June 19, 2020 10:37 AM

  • Remove From My Forums
  • Question

  • We’re using a physical installation of Windows Server 2019 Standard at a French location. The server is working normally. Task Scheduler is used for a small number of tasks. One of the tasks is supposed to repeat every half hour. The task indeed starts every
    half hour but it runs four times in succession. I have attached screen prints of the task trigger screen and the task history. Why does Event ID 100 (Task started) appear four times at 08:58:01?

Answers

  • I created a task that runs a .CMD-file that launched DIR C:. Since CMD.EXE was never explicitly called, the /C parameter was not needed. The task was configured to run every 15 min and that’s exactly what it did. The task never repeated.

    Interestingly, the original task was left running, also configured to run every 15 min. That’s exactly what it did as well. There were no repeats.

    What changed? To solve a separate problem in Task Scheduler with a different task (see my post

    here, I modified the following GPO:

    Configuration ordinateur | Stratégies | Paramètres Windows | Paramètres de sécurité | Stratégies locales | Options de sécurité | Accès réseau : ne pas autoriser le stockage de mots de passe et d’informations d’identification pour l’authentification du réseau

    Initially, I Defined and Enabled the setting, which proved disastrous. Then I Disabled the setting, but left it Defined.

    Did that have an effect on this task? Maybe not, but I’m done testing Task Scheduler for now.

    Thanks again for your suggestions.

    regards, AndyA

    • Edited by

      Thursday, June 18, 2020 3:29 PM

    • Proposed as answer by
      sylvia_chenMicrosoft contingent staff
      Friday, June 19, 2020 7:07 AM
    • Marked as answer by
      AAronoff
      Friday, June 19, 2020 10:37 AM

Понравилась статья? Поделить с друзьями:
  • Планировщик заданий командная строка windows 10
  • Планировщик задач в windows server 2016
  • Планировщик заданий выбранная задача 0 больше не существует windows 7
  • Планировщик задач в windows server 2008
  • Планировщик заданий в windows server 2019