Get-​Azure​Sql​Database​Operation

Gets the status of database operations on an Azure server.

Syntax

Get-AzureSqlDatabaseOperation
   -ConnectionContext <IServerDataServiceContext>
   [-Database <Database>]
   [-DatabaseName <String>]
   [-OperationGuid <Guid>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSqlDatabaseOperation
   [-Database <Database>]
   [-DatabaseName <String>]
   [-OperationGuid <Guid>]
   [-Profile <AzureSMProfile>]
   -ServerName <String>
   [<CommonParameters>]

Description

The Get-AzureSqlDatabaseOperation cmdlet gets the status of database operations on the specified Azure server. If you specify only the ServerName or ConnectionContext parameter, the cmdlet gets all the database operations for the server. If you also specify a database by using the Database or DatabaseName parameter, this cmdlet gets all the operations for the specified database. If you specify an operation GUID, and ServerName or ConnectionContext, the cmdlet gets a single database operation.

Examples

Example 1: Get the status of all database operations for a database

PS C:\> $Operations = Get-AzureSqlDatabaseOperation -ConnectionContext $Context -DatabaseName "Database17"

This command gets the status of all database operations on the database named Database17 on the server that the connection context $Context specifies.

Example 2: Get the status of all database operations for a server

PS C:\> $Operations = Get-AzureSqlDatabaseOperation -ConnectionContext $Context

This command gets the status of all database operations on the server that the connection context $Context specifies.

Required Parameters

-ConnectionContext

Specifies the connection context of a server.

Type:IServerDataServiceContext
Aliases:Context
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-ServerName

Specifies the name of a server.

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

Optional Parameters

-Database

Specifies an object that represents an Azure SQL Database. If you specify this parameter, you must specify the ServerName parameter or ConnectionContext parameter.

Type:Database
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-DatabaseName

Specifies the name of a database. If you specify this parameter, you must specify the ServerName parameter or the ConnectionContext parameter.

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

Specifies the operation ID that represents a specific database operation for which this cmdlet gets status. You can obtain operation IDs by requesting all the database operations for a Azure SQL Database or server. If you specify this parameter, you must specify the ServerName parameter or the ConnectionContext parameter.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.SqlDatabaseServerContext

Inputs

System.Guid

Outputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database.DatabaseOperationResponseList[]

This cmdlet returns an array of DatabaseOperationResponseList objects if you get multiple operations.

Outputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database.DatabaseOperationResponse