Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Set the echange server parameter.
- $PSEmailServer = "your.mail.server"
- ##Call the schtasks to disable the task (TN stands for task Name)
- SCHTASKS /Change /S Server /U admin /P password /TN "Task To kill" /Disable
- ## Sending the email to let you know it's done.
- 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