Advertisement
MEaly58

Disable Scheduled Task

Oct 31st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##Set the echange server parameter.
  2. $PSEmailServer = "your.mail.server"
  3. ##Call the schtasks to disable the task (TN stands for task Name)
  4. SCHTASKS /Change /S Server /U admin /P password /TN "Task To kill" /Disable
  5. ## Sending the email to let you know it's done.
  6. Send-MailMessage -From "Admin@yourcmpany.com" -To "you@yourcompany.com" -Subject "Task Turned off" -Body "The task has been turned off" -Priority High
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement