Get-​Azure​Sql​Job​Target

Gets one or multiple containers of databases that can be used as a target for job runs.

Syntax

Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -CustomCollectionName <String>
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -DatabaseName <String>
   -ServerName <String>
   [-LiteralServerName]
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -ParentCustomCollectionName <String>
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -ParentTargetId <Guid>
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -ServerName <String>
   [-LiteralServerName]
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -ShardMapManagerDatabaseName <String>
   -ShardMapManagerServerName <String>
   -ShardMapName <String>
   [-LiteralServerName]
   [<CommonParameters>]
Get-AzureSqlJobTarget
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   -TargetId <Guid[]>
   [<CommonParameters>]

Description

The Get-AzureSqlJobTarget cmdlet gets one or multiple containers of databases that can be used as a target for job execution.

There are multiple supported types of targets, namely custom collection targets, database targets, and Elastic Scale shard map targets. Each target type can be retrieved through the different parameter sets within this cmdlet.

Examples

Example 1: Get a custom collection

PS C:\>Get-AzureSqlJobTarget -CustomCollectionName "MyCustomCollection"
TargetDescription             CustomCollectionName          TargetId                                         TargetType
-----------------             --------------------          --------                                         ----------
{"CustomCollectionName":"m... myCustomCollection            b525727e-6ed0-44cc-94da-63...              CustomCollection

This command gets a custom collection named MyCustomCollection.

Example 2: Get all child targets within the specified parent custom collection

PS C:\>Get-AzureSqlDatabaseJobTarget -ParentCustomCollectionName "MyCustomCollection"
TargetDescription                       CustomCollectionName                    TargetId                                                           TargetType
-----------------                       --------------------                    --------                                                           ----------
{"CustomCollectionName":"myCustomCol... myCustomCollection                      b525727e-6ed0-44cc-94da-63c543e383d7                         CustomCollection
{"ServerName":"myServer.database.win...                                         0f31294a-f42f-414d-a00f-4df43e9bd493                                 Database

This command gets all child targets within the provided parent custom collection named MyCustomCollection.

Example 3: Get an elastic scale shard map target

PS C:\>Get-AzureSqlJobTarget -ShardMapManagerServerName "MyShardMapManagerServer.database.contoso.net" -ShardMapManagerDatabaseName "MyShardMapManagerDatabase" -ShardMapName "MyShardMap"
TargetDescription               : {"ShardMapName":"myShardMap","ShardMapManagerServerName":"myShardMapManagerServer.dat
                                  abase.contoso.net","ShardMapManagerDatabaseName":"myShardMapManagerDatabase"}
ShardMapName                    : MyShardMap
ShardMapManagerServerName       : MyShardMapManagerServer.database.contoso.net
ShardMapManagerDatabaseName     : MyShardMapManagerDatabase
ShardMapManagerDatabaseTargetId : 9eb3ee50-e4b2-4feb-b2f7-3ee1cd7f7997
ShardMapManagerCredentialName   : myShardMapCredentials
TargetId                        : 1afd9326-1277-4344-832f-8170d0375ff7
TargetType                      : ShardMap

This command gets an elastic scale shard map target.

Example 4: Get a database target

PS C:\>Get-AzureSqlJobTarget -ServerName "myServer.database.contoso.net" -DatabaseName "MyDatabase"
TargetDescription : {"ServerName":"myServer.database.contoso.net","DatabaseName":"myDatabase"}
ServerName        : myServer.database.contoso.net
DatabaseName      : myDatabase
TargetId          : 0f31294a-f42f-414d-a00f-4df43e9bd493
TargetType        : Database

This command gets a database target named MyDatabase.

Example 5: Get all job targets

PS C:\>Get-AzureSqlJobTarget
TargetDescription             CustomCollectionName          TargetId                                         TargetType
-----------------             --------------------          --------                                         ----------
{"CustomCollectionName":"m... myCustomCollection            b525727e-6ed0-44cc-94da-63...              CustomCollection
{"ServerName":"myServer.da...                               0f31294a-f42f-414d-a00f-4d...                      Database
{"ServerName":"myShardMapM...                               9eb3ee50-e4b2-4feb-b2f7-3e...                      Database
{"ShardMapName":"myShardMa...                               1afd9326-1277-4344-832f-81...                      ShardMap

This command gets all job targets.

Required Parameters

-CustomCollectionName

Specifies the name of the custom collection that this cmdlet gets.

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

Specifies the name of a database within a database target that this cmdlet gets.

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

Specifies the name of the parent custom collection name to get targets. This cmdlet gets all child targets of the specified custom…

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

Specifies the parent target ID. If you specify this parameter, this cmdlet returns all child targets of the specified parent target ID.

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

Specifies the name of a database server within a database target that this cmdlet gets.

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

Specifies the elastic scale shard map database name.

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

Specifies the elastic scale shard map server name.

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

Specifies the elastic scale shard map name.

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

Specifies the target ID.

Type:Guid[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
-LiteralServerName

{{Fill LiteralServerName Description}}

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