powershellcmdscheduled-taskspowershell-2.0windows-server-2008-r2

Edit triggers for a Windows Task Scheduler Task


We currently have several hundred tasks scheduled in Windows Task Scheduler on our server 2008 box. There are a number of tasks that are running every half hour indefinitely. Is there any way to use a script to change the triggers on those tasks so that they will only run every half hour M-F?


Solution

  • Yes, if you use the TaskService COM object. For some example scripts that use this object, see the following:

    1. Rename Scheduled Tasks in Windows 7, Windows Server 2008, and Windows Vista

    2. How-To: Use PowerShell to Report on Scheduled Tasks

    3. Updating a Scheduled Task's Credentials

      Script: https://gist.github.com/Bill-Stewart/363fdf761499a071439c8ac0c18dcd54

    Using the schtasks.exe utility is rather limited past Windows XP/Server 2003.