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

PS C:\> $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

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
-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
-ParentObject

The agent input object

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

The agent resource id

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

The resource group name

Type:String
Position:0
Default value:None
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
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.AzureSqlElasticJobAgentModel

Outputs

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