Editar

Compartilhar via


New-AzSqlElasticJob

Creates a new job

Syntax

New-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-AgentName] <String>
   [-Name] <String>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentObject] <AzureSqlElasticJobAgentModel>
   [-Name] <String>
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentObject] <AzureSqlElasticJobAgentModel>
   [-Name] <String>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentObject] <AzureSqlElasticJobAgentModel>
   [-Name] <String>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentResourceId] <String>
   [-Name] <String>
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentResourceId] <String>
   [-Name] <String>
   [-RunOnce]
   [-StartTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlElasticJob
   [-ParentResourceId] <String>
   [-Name] <String>
   -IntervalType <String>
   -IntervalCount <UInt32>
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-Description <String>]
   [-Enable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzSqlElasticJob cmdlet creates a new job

Examples

Example 1: Creates a new job

$agent = Get-AzSqlElasticJobAgent -ResourceGroupName rg -ServerName elasticjobserver -Name agent
$agent | New-AzSqlElasticJob -Name job1

JobName Version Description StartTime           EndTime                ScheduleType Interval Enabled
------- ------- ----------- ---------           -------                ------------ -------- -------
job1    0                   6/1/2018 9:46:29 PM 12/31/9999 11:59:59 AM Once                  False

Creates a new job

Example 2

Creates a new job. (autogenerated)

New-AzSqlElasticJob -Name job1 -RunOnce

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

-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

-ParentObject

The agent input object

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

-ParentResourceId

The agent resource id

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

-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

AzureSqlElasticJobAgentModel

Outputs

AzureSqlElasticJobModel