Set-DbaAgentJobOutputFile View Source Rob Sewell, sqldbawithabeard.com Windows, Linux, macOS Synopsis Configures the output file path for SQL Server Agent job steps to capture step execution logs.
Description Modifies the output file location where SQL Server Agent writes job step execution details, error messages, and command output. This centralizes logging for troubleshooting failed jobs, monitoring step execution, and maintaining audit trails without manually editing each job step through SQL Server Management Studio.
Set-DbaAgentJobOwner View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS Synopsis Updates SQL Server Agent job ownership to ensure jobs are owned by a specific login
Description This function standardizes SQL Agent job ownership by updating jobs that don’t match a specified owner login. It’s commonly used for security compliance, post-migration cleanup, and environment standardization where consistent job ownership is required.
By default, jobs are reassigned to the ‘sa’ account (or the renamed sysadmin account if ‘sa’ was renamed), but you can specify any valid login.
Set-DbaAgentJobStep View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Modifies properties of existing SQL Agent job steps or creates new ones with Force parameter.
Description Modifies SQL Agent job step properties including commands, subsystems, retry logic, success/failure actions, and execution context. Updates existing job steps by name or creates new steps when using the -Force parameter, eliminating the need to manually edit job steps through SSMS.
Common use cases include changing job step commands during deployments, updating database contexts when moving jobs between environments, modifying retry settings for intermittent failures, and adjusting success/failure flow logic.
Set-DbaAgentOperator View Source Tracy Boggiano (@TracyBoggiano), databasesuperhero.com Windows, Linux, macOS Synopsis Modifies existing SQL Agent operator contact details, pager schedules, and failsafe settings.
Description Modifies existing SQL Agent operators by updating their contact information, pager notification schedules, and failsafe operator configuration. This lets you change email addresses, pager contacts, net send addresses, and specify when pager notifications should be active without having to manually update operators through SQL Server Management Studio.
Set-DbaAgentSchedule View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Modifies properties of existing SQL Agent job schedules
Description Modifies the timing, frequency, and other properties of existing SQL Agent job schedules without recreating them. You can update schedule frequency (daily, weekly, monthly), change start/end times and dates, enable or disable schedules, and rename them. The function works with schedules already attached to jobs and validates all timing parameters to prevent invalid configurations.
Start-DbaAgentJob View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Starts SQL Server Agent jobs and optionally waits for completion
Description Starts one or more SQL Server Agent jobs that are currently idle. This function validates jobs are in an idle state before starting them and can optionally wait for job completion before returning results. You can start all jobs, specific jobs by name, or exclude certain jobs from execution.
Stop-DbaAgentJob View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Stops running SQL Server Agent jobs by calling their Stop() method.
Description Stops currently executing SQL Server Agent jobs and returns the job objects for verification after the stop attempt.
Perfect for halting runaway jobs during maintenance windows, stopping jobs that are causing blocking or performance issues, or clearing job queues before scheduled operations.
The function automatically skips jobs that are already idle and can optionally wait until jobs have completely finished stopping before returning results.
Test-DbaAgentJobOwner View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS Synopsis Identifies SQL Agent jobs with incorrect ownership for security compliance auditing
Description This function audits SQL Agent job ownership by comparing each job’s current owner against a target login, typically ‘sa’ or another sysadmin account. Jobs owned by inappropriate accounts can pose security risks, especially if those accounts are disabled, deleted, or have reduced permissions. By default, it checks against the ‘sa’ account (or renamed sysadmin), but you can specify any valid login for your organization’s security standards.