Get-AzConnectedMachine

Retrieves information about the model view or the instance view of a hybrid machine.

Syntax

Get-AzConnectedMachine
   [-SubscriptionId <String[]>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzConnectedMachine
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-Expand <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzConnectedMachine
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-Expand <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]

Description

Retrieves information about the model view or the instance view of a hybrid machine.

Examples

Example 1: List all connected machines in a subscription

Get-AzConnectedMachine -SubscriptionId ********-****-****-****-**********

Name           Location OSName   Status     ProvisioningState
----           -------- ------   ------     -----------------
winwestus2_1   westus2  windows  Connected  Succeeded
linwestus2_1   westus2  linux    Connected  Succeeded
winwestus2_2   westus2  windows  Connected  Succeeded
winwestus2_3   westus2  windows  Connected  Succeeded

Lists all connected machines in a subscription. If subscription isn't specified, it will use the subscription from your current Azure PowerShell context.

Example 2: List all connected machines in a resource group

Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines

Name           Location OSName   Status     ProvisioningState
----           -------- ------   ------     -----------------
winwestus2_2   westus2  windows  Connected  Succeeded
winwestus2_3   westus2  windows  Connected  Succeeded

List all connected machines in a resource group.

Example 3: Get a connected machine in a resource group by name

Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines -Name winwestus2_1

Name           Location OSName   Status     ProvisioningState
----           -------- ------   ------     -----------------
winwestus2_1   westus2  windows  Connected  Succeeded

Get a connected machine in a resource group by name.

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 expand expression to apply on the operation.

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

-Name

The name of the hybrid machine.

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

-ResourceGroupName

The name of the resource group. The name is case insensitive.

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

-SubscriptionId

The ID of the target subscription.

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

Outputs

IMachine