Thor Logo dbatools

Job

New-DbaAgentJobCategory

Sander Stad (@sqlstad), sqlstad.nl

New-DbaAgentJobCategory View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Creates new SQL Server Agent job categories for organizing and managing jobs. Description Creates custom job categories in SQL Server Agent to help organize and classify jobs by function, department, or priority level. Job categories provide a way to group related jobs together for easier management and reporting, replacing the need to manually create categories through SQL Server Management Studio.

Read more

New-DbaAgentJobStep

Sander Stad (@sqlstad), sqlstad.nl

New-DbaAgentJobStep View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Creates a new step within an existing SQL Server Agent job with configurable execution options and flow control Description Creates individual job steps within SQL Server Agent jobs, allowing you to build complex automation workflows without manually configuring each step through SSMS. Each step can execute different types of commands (T-SQL, PowerShell, SSIS packages, OS commands) and includes retry logic, success/failure branching, and output capture.

Read more

New-DbaAgentSchedule

Sander Stad (@sqlstad), sqlstad.nl

New-DbaAgentSchedule View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Creates a new SQL Server Agent schedule for automated job execution Description Creates a new schedule in the msdb database that defines when SQL Server Agent jobs should execute. Schedules can be created as standalone objects or immediately attached to existing jobs, allowing you to standardize timing across multiple jobs without recreating the same schedule repeatedly. This replaces the need to manually create schedules through SQL Server Management Studio or T-SQL, while providing comprehensive validation of schedule parameters and frequency options.

Read more

Remove-DbaAgentJob

Sander Stad (@sqlstad, sqlstad.nl)

Remove-DbaAgentJob View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Removes SQL Server Agent jobs from one or more instances with options to preserve history and schedules. Description Removes SQL Server Agent jobs from the target instances using the sp_delete_job system stored procedure. By default, both job history and unused schedules are deleted along with the job itself. You can optionally preserve job execution history for compliance or troubleshooting purposes, and keep unused schedules that might be reused for other jobs.

Read more

Remove-DbaAgentJobCategory

Sander Stad (@sqlstad, sqlstad.nl)

Remove-DbaAgentJobCategory View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Removes SQL Server Agent job categories from one or more instances. Description Removes custom SQL Server Agent job categories that are no longer needed for job organization and management. This is useful when cleaning up obsolete categories after reorganizing jobs or migrating workloads between environments. Any jobs currently assigned to a removed category will automatically be reassigned to the default “[Uncategorized (Local)]” category.

Read more

Remove-DbaAgentJobStep

Sander Stad (@sqlstad), sqlstad.nl

Remove-DbaAgentJobStep View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Removes specified job steps from SQL Server Agent jobs. Description Removes individual job steps from SQL Server Agent jobs by step name. This function validates that both the job and step exist before attempting removal, preventing errors when cleaning up outdated or broken job steps. Useful for job maintenance tasks like removing obsolete backup steps, failed notification steps, or deprecated processes without affecting the rest of the job workflow.

Read more

Remove-DbaAgentSchedule

Sander Stad (@sqlstad), sqlstad.nl

Remove-DbaAgentSchedule View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Removes SQL Server Agent schedules from one or more instances. Description Removes SQL Server Agent schedules from the msdb database, handling both unused schedules and those currently assigned to jobs. The function first removes schedule associations from any jobs using the schedule, then drops the schedule itself to prevent orphaned references. Use this when cleaning up unused schedules during maintenance, consolidating multiple schedules, or removing schedules as part of job reorganization.

Read more

Set-DbaAgentJob

Sander Stad (@sqlstad), sqlstad.nl

Set-DbaAgentJob View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Modifies existing SQL Server Agent job properties and notification settings. Description Updates various properties of SQL Server Agent jobs including job name, description, owner, enabled/disabled status, notification settings, and schedule assignments. This function lets you modify jobs without using SQL Server Management Studio, making it useful for standardizing job configurations across multiple instances or automating job maintenance tasks. You can update individual jobs or perform bulk changes across multiple jobs and SQL Server instances simultaneously.

Read more

Set-DbaAgentJobCategory

Sander Stad (@sqlstad), sqlstad.nl

Set-DbaAgentJobCategory View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Renames SQL Server Agent job categories to standardize naming conventions across instances. Description Renames existing SQL Server Agent job categories by updating their names in the msdb database. This is particularly useful for standardizing job category naming conventions across multiple environments or correcting categories that were created with inconsistent names. The function validates that source categories exist and prevents renaming to names that already exist, helping maintain clean job organization within SQL Server Agent.

Read more

Set-DbaAgentJobOutputFile

Rob Sewell, sqldbawithabeard.com

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.

Read more
Page 2 of 3