Düzenle

Aracılığıyla paylaş


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

$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

Example 2

Set-AzSqlElasticJob -AgentName agent -Enable -IntervalCount 1 -IntervalType Hour -Name step1 -ResourceGroupName MyResourceGroup -ServerName s1 -StartTime '9/16/2016 11:31:12'

Parameters

-AgentName

The agent name

Type:String
Position:2
Default value:None
Required:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

The job description

Type:String
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndTime

The job schedule end time

Type:Nullable<T>[DateTime]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

The job input object

Type:AzureSqlElasticJobModel
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-IntervalCount

The recurring schedule interval count

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:True
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
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The job name

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

-ResourceGroupName

The resource group name

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The job resource id

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RunOnce

The flag to indicate job will be run once

Type:SwitchParameter
Position:Named
Default value:False
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServerName

The server name

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

The job schedule start time

Type:Nullable<T>[DateTime]
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureSqlElasticJobModel

Outputs

AzureSqlElasticJobModel