Get-AzNetworkCloudVirtualMachine
Get properties of the provided virtual machine.
Syntax
Get-AzNetworkCloudVirtualMachine
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzNetworkCloudVirtualMachine
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzNetworkCloudVirtualMachine
-ResourceGroupName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzNetworkCloudVirtualMachine
-InputObject <INetworkCloudIdentity>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
Get properties of the provided virtual machine.
Examples
Example 1: List virtual machines by subscription
Get-AzNetworkCloudVirtualMachine -SubscriptionId subscriptionId
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType AzureAsyncOperation
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ -
eastus testVM123 07/07/2023 16:50:12 <user> User 07/08/2023 03:19:08 <Identity> A
This command gets all virtual machines under a subscription.
Example 2: Get virtual machine
Get-AzNetworkCloudVirtualMachine -Name vmName -ResourceGroupName resourceGroup -SubscriptionId subscriptionId
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ --------------------------------------------- ------------------------
eastus <VM name> 07/07/2023 16:50:12 <user> User 07/08/2023 03:19:08 <Identity> Application <RG>
This command gets a virtual machine by name.
Example 2: List virtual machines by resource group
Get-AzNetworkCloudVirtualMachine -ResourceGroupName resourceGroup -SubscriptionId subscriptionId
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType ResourceGroupName
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ --------------------------------------------- ------------------------
eastus <VM name> 07/07/2023 16:50:12 <user> User 07/08/2023 03:19:08 <Identity> Application <RG>
eastus <VM name> 07/07/2023 16:50:12 <user> User 07/08/2023 03:19:08 <Identity> Application <RG>
eastus <VM name> 07/07/2023 16:50:12 <user> User 07/08/2023 03:19:08 <Identity> Application <RG>
This command lists all virtual machines in a resource group.
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 |
-InputObject
Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
Type: | INetworkCloudIdentity |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
The name of the virtual machine.
Type: | String |
Aliases: | VirtualMachineName |
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. The value must be an UUID.
Type: | String[] |
Position: | Named |
Default value: | (Get-AzContext).Subscription.Id |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |