Set-AzSqlElasticJob

Updates a job

Syntax

Set-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-InputObject] <AzureSqlElasticJobModel>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-InputObject] <AzureSqlElasticJobModel>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-InputObject] <AzureSqlElasticJobModel>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-ResourceId] <String>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-ResourceId] <String>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSqlElasticJob
   [-ResourceId] <String>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Enable]
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzSqlElasticJob cmdlet updates a job

Examples

Example 1 - Updates a job to start an hour from now and repeat every 1 hour

PS C:\> $job = Get-AzSqlElasticJob -ResourceGroupName rg -ServerName elasticjobserver -AgentName agent -Name job1
$job | Set-AzSqlElasticJob -IntervalType Hour -IntervalCount 1 -StartTime (Get-Date).AddHours(1) -Enable

JobName Version Description StartTime            EndTime                ScheduleType Interval Enabled
------- ------- ----------- ---------            -------                ------------ -------- -------
job1    0                   6/1/2018 10:50:15 PM 12/31/9999 11:59:59 AM Recurring    PT1H     True

Updates a job

Parameters

-AgentName

The agent name

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

The job description

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Enable

The flag to indicate customer wants this job to be enabled.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-EndTime

The job schedule end time

Type:System.Nullable`1[System.DateTime]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

The job input object

Type:Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobModel
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-IntervalCount

The recurring schedule interval count

Type:System.Nullable`1[System.UInt32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IntervalType

The recurring schedule interval type - Can be Minute, Hour, Day, Week, Month

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

The job name

Type:String
Aliases:JobName
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

The resource group name

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId

The job resource id

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RunOnce

The flag to indicate job will be run once

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-ServerName

The server name

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartTime

The job schedule start time

Type:System.Nullable`1[System.DateTime]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobModel

Outputs

Microsoft.Azure.Commands.Sql.ElasticJobs.Model.AzureSqlElasticJobModel