你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzSqlVM

Gets a SQL virtual machine.

Syntax

Get-AzSqlVM
   [-SubscriptionId <String[]>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzSqlVM
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-Expand <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzSqlVM
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzSqlVM
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   -GroupName <String>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzSqlVM
   -InputObject <ISqlVirtualMachineIdentity>
   [-Expand <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]

Description

Gets a SQL virtual machine.

Examples

Example 1: List all SQL Virtual Machines in a Resource Group

Get-AzSqlVM -ResourceGroupName 'ResourceGroup01'

Location	Name		ResourceGroupName
--------	----		-----------------
eastus		sqlvm1		ResourceGroup01	
eastus		sqlvm2		ResourceGroup01	
eastus		sqlvm3		ResourceGroup02

Example 2: Get a SQL Virtual Machine

Get-AzSqlVM -ResourceGroupName 'ResourceGroup01' -Name 'sqlvm1'

Location	Name		ResourceGroupName
--------	----		-----------------
eastus		sqlvm1		ResourceGroup01

Example 3: List all SQL Virtual Machines in a SQL Virtual Machine Group

Get-AzSqlVM -ResourceGroupName 'ResourceGroup01' -GroupName 'sqlvmgroup01'

Location	Name		ResourceGroupName
--------	----		-----------------
eastus		sqlvm1		ResourceGroup01	
eastus		sqlvm2		ResourceGroup01

Parameters

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Expand

The child resources to include in the response.

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

-GroupName

Name of the SQL virtual machine group.

Type:String
Aliases:SqlVirtualMachineGroupName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:ISqlVirtualMachineIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Name of the SQL virtual machine.

Type:String
Aliases:SqlVirtualMachineName, SqlVMName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

Subscription ID that identifies an Azure subscription.

Type:String[]
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ISqlVirtualMachineIdentity

Outputs

ISqlVirtualMachine