Add-​Azure​Sql​Job​Child​Target

Associates a target to a custom collection target.

Syntax

Add-AzureSqlJobChildTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -CustomCollectionName <String>
   -DatabaseName <String[]>
   -ServerName <String[]>
   [-Exclude]
   [-LiteralServerName]
   [<CommonParameters>]
Add-AzureSqlJobChildTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -CustomCollectionName <String>
   -TargetId <Guid[]>
   [-Exclude]
   [<CommonParameters>]

Description

The Add-AzureSqlJobChildTarget cmdlet associates a target to a custom collection target. Jobs that are run targeting custom collections are expanded to target all targets associated within the custom collection at the time this cmdlet is run.

Examples

Example 1: Add a database target to a custom collection as a child target

PS C:\>Add-AzureSqlDatabaseJobChildTarget -CustomCollectionName "MyCustomCollection" -ServerName "MyServer.database.contoso.net" -DatabaseName "MyDatabase"

This command adds a database target to a custom collection as a child target. Database targets can be child targets of multiple custom collections.

Example 2: Add a custom collection to another custom collection

PS C:\>Add-AzureSqlDatabaseJobChildTarget -CustomCollectionName "MyCustomCollection" -TargetId (Get-AzureSqlDatabaseJobTarget -CustomCollectionName "MyOtherCustomCollection").TargetId

This command adds a custom collection to another custom collection.

Required Parameters

-CustomCollectionName

Specifies the name of the custom collection target to contain the association of the provided database.

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

Specifies the database name of the database target to add as a child target to the specified custom collection.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServerName

Specifies the server name of the database target to add as a child target to the specified custom collection.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TargetId

Specifies the ID of the target to add into the provided custom collection.

Type:Guid[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-AzureSqlJobConnection

Specifies the connection state object for the job. You can get the connection state object through the New-AzureSqlJobConnection cmdlet. If you do not specify this parameter, the connection state is used from a prior call to the Use-AzureSqlJobConnection cmdlet.

Type:AzureSqlJobConnection
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Exclude

{{Fill Exclude Description}}

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

{{Fill LiteralServerName Description}}

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