Get-MgmtSvcSqlDatabase

Get-MgmtSvcSqlDatabase

Gets a SQL Server database.

Syntax

Parameter Set: Default
Get-MgmtSvcSqlDatabase [-AdminUri] <Uri> [-Token] <String> [-HostingServerId] <String> [[-Name] <String> ] [-Descending] [-DisableCertificateValidation] [ <CommonParameters>]

Detailed Description

The Get-MgmtSvcSqlDatabase cmdlet gets SQL Server databases. By default, all SQL Server databases for a hosting server are returned. To get a specific database, use the Name parameter.

Parameters

-AdminUri<Uri>

Specifies the URI of the Windows Azure Pack administrator API. Use the following format: https://<computer>:<port>, where <computer> is the computer on which the administrator API is installed.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Descending

Indicates that the returned databases are displayed in descending order.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableCertificateValidation

Disables certificate validation for the Windows Azure Pack installation.

If you specify this parameter, you can use self-signed certificates.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HostingServerId<String>

Specifies the ID of a SQL Server hosting server.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a SQL Server database.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Token<String>

Specifies an identity token. To create a token, use the Get-MgmtSvcToken cmdlet.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • SqlDatabase

    This cmdlet emits a SqlDatabase object.

Examples

Example 1: Get a SQL database by name

NOTE: This example assumes that you have created a token by using Get-MgmtSvcToken and have stored it in a variable named $Token.

This command gets the database named DB01 on the hosting server with the ID u37k25.

PS C:\> Get-MgmtSvcSqlDatabase -AdminUri "https://Computer01:30004" -Token $Token -HostingServerId "u37k25" -Name "DB01"

Get-MgmtSvcSqlHostingServer