Start Scheduled Tasks remotely

When you maintain many servers that require manually triggering the same scheduled task, you can simplify the process by triggering the scheduled task remotely.

In this example, I assume the script is being executed on a dedicated management server (aka job server) within an Exchange Server 2013 environment. The scheduled task must exist on all servers having the same name.

Create a simple PowerShell script at a file location of your choice (i.e., D:\Scripts\Start-RemoteScheduledTasks.ps1)

$cimSession = New-CimSession -ComputerName SERVER1,SERVER2,SERVER3,SERVER4
Start-ScheduledTask TASKNAME -CimSession $cim
SessionRemove-CimSession $cimSession

Now create a new shortcut on your server desktop with the following configuration:

Target: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command “& D:\Scripts\Start-RemoteScheduledTasks.ps1”

Select “Run as Administrator” in Shortcut -> Advanced settings if required.

Enjoy.


This post was published originally on my legacy blog SF-Tools.

%d Bloggern gefällt das: