Forum Discussion
Randy_Thomas
Aug 27, 2021Copper Contributor
Task Scheduler
I need some help setting up the task scheduler on a second server, so if one server isn't available the tasks will still get run
- Reza_AmeriSilver ContributorI am not sure about your configuration but generally when the other server is not available , it should have certain condition for example if let say if they are communicating and the server is not responding (not available), it should create some error log in the event viewer.
In this case, you may open Task Scheduler and create a new task and under Triggers tab, create a New... and Begin the task and select On an event, select the event associated with the condition when server is not available.
Otherwise, you will need to run a PowerShell script and keep it running all the time and then define condition to identify when server is not available and run the task.- Randy_ThomasCopper ContributorI like the shell script idea, you wouldn't happen to have any examples would you?
- Reza_AmeriSilver Contributor
It depends on your logic, I am not sure how you define unavailable server. You need to write if statement and if it was true then create a task.
To create task in PowerShell, you may use New-ScheduledTask command.
You may find details and examples on New-ScheduledTask (ScheduledTasks) | Microsoft Docs