Removing scheduled tasks requires two functions. The function DS_GetAllScheduledTaskSubFolders retrieves all functions in all (sub)folders. The function DS_DeleteScheduledTask deletes the scheduled task (see lines 433 to 519). Part of the code I got from the Microsoft Script Center repository ( -ScheduledTask). The code of the two functions is as follows: