Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Disable SQL Agent Jobs with PowerShell

I had a need today to disable all of our admin jobs while I moved our admin database to another file location. We didn’t want to get a lot of alerts or job failures during the move, even though it took less than 5 minutes. This script runs best in sqlps or by adding the appropriate snap-ins to your regular console.

cd SQLSERVER:\SQL\[server]\[instance]\JobServer\Jobs
dir | ?{$_.Name.StartsWith('!Admin')} | %{$_.IsEnabled = $false; $_.Alter()} #rerun with $true to enable

Comments

Posted by Anonymous on 26 April 2011

Pingback from  Dew Drop – April 26, 2011 | Alvin Ashcraft's Morning Dew

Posted by Anonymous on 27 April 2011

Pingback from  PremiumReseller.com cPanel WHMReseller – Windows 2008 Reseller … | Hosting Review Directory

Leave a Comment

Please register or log in to leave a comment.