dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


New-DbaAgentSchedule

New-DbaAgentSchedule will help create a new schedule for a job. If the job parameter is not supplied the schedule will not be attached to a job.

Screenshots

dbatools - New-DbaAgentSchedule

Examples

Creates a schedule with a daily frequency every day. It also assumes default values for the start date, start time, end date and end time.

New-DbaAgentSchedule -SqlInstance localhost\SQL2016 -Schedule daily -FrequencyType Daily -FrequencyInterval Everyday -Force

Author

This command was created by Sander Stad. You can find Sander on Twitter and his blog.

Get-Help

From PowerShell, execute Get-Help New-DbaAgentSchedule -Detailed for more information on this function.

Source Code

Want to see the source code? View New-DbaAgentSchedule.ps1 on GitHub
 

Related commands