Get-AzDisk

This article will discuss the syntax and usage of the Get-AzDisk PowerShell command and provide several examples of its use.

This command helps you to retrieve the properties of a Managed disk.

Syntax

Get-AzDisk
Get-AzDisk -ResourceGroupName] <String>
Get-AzDisk -ResourceGroupName <String>  -DiskName <String>

Examples

Example-1:

You can execute the below Azure PowerShell command to get the properties of all the managed disks under the subscription.

Get-AzDisk

After executing the above command, I got the below-expected output

ResourceGroupName            : DEMO1234
ManagedBy                    : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo1234/providers/Microsoft.Compute/virtualMachines/
                               AzureLessonsVM
ManagedByExtended            : {}
Sku                          : Microsoft.Azure.Management.Compute.Models.DiskSku
Zones                        : {1}
TimeCreated                  : 14-05-2024 07:37:12
OsType                       : Linux
HyperVGeneration             : V2
CreationData                 : Microsoft.Azure.Management.Compute.Models.CreationData
DiskSizeGB                   : 32
DiskSizeBytes                : 34359738368
UniqueId                     : 35aef908-9f87-4c6c-b009-a55f6668c5ae
EncryptionSettingsCollection : 
ProvisioningState            : Succeeded
DiskIOPSReadWrite            : 120
DiskMBpsReadWrite            : 25
DiskIOPSReadOnly             : 
DiskMBpsReadOnly             : 
DiskState                    : Reserved
Encryption                   : Microsoft.Azure.Management.Compute.Models.Encryption
MaxShares                    : 
ShareInfo                    : {}
Id                           : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/DEMO1234/providers/Microsoft.Compute/disks/AzureLesso
                               nsVM_OsDisk_1_35aef9089f874c6cb009a55f6668c5ae
Name                         : AzureLessonsVM_OsDisk_1_35aef9089f874c6cb009a55f6668c5ae
Type                         : Microsoft.Compute/disks
Location                     : eastus
ExtendedLocation             : 
Tags                         : {}
NetworkAccessPolicy          : AllowAll
DiskAccessId                 : 
Tier                         : P4
BurstingEnabled              : 
PurchasePlan                 : 
SupportsHibernation          : True
SecurityProfile              : 
PublicNetworkAccess          : Enabled
SupportedCapabilities        : Microsoft.Azure.Management.Compute.Models.SupportedCapabilities
DataAccessAuthMode           : 
CompletionPercent            : 

ResourceGroupName            : DEMO1234
ManagedBy                    : 
ManagedByExtended            : {}
Sku                          : Microsoft.Azure.Management.Compute.Models.DiskSku
Zones                        : {1}
TimeCreated                  : 14-05-2024 12:56:20
OsType                       : 
HyperVGeneration             : 
CreationData                 : Microsoft.Azure.Management.Compute.Models.CreationData
DiskSizeGB                   : 4
DiskSizeBytes                : 4294967296
UniqueId                     : bb46d3e1-d22c-4202-ae3f-0aad2d346500
EncryptionSettingsCollection : 
ProvisioningState            : Succeeded
DiskIOPSReadWrite            : 500
DiskMBpsReadWrite            : 100
DiskIOPSReadOnly             : 
DiskMBpsReadOnly             : 
DiskState                    : Unattached
Encryption                   : Microsoft.Azure.Management.Compute.Models.Encryption
MaxShares                    : 
ShareInfo                    : {}
Id                           : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/DEMO1234/providers/Microsoft.Compute/disks/testing
Name                         : testing
Type                         : Microsoft.Compute/disks
Location                     : eastus
ExtendedLocation             : 
Tags                         : {}
NetworkAccessPolicy          : AllowAll
DiskAccessId                 : 
Tier                         : 
BurstingEnabled              : 
PurchasePlan                 : 
SupportsHibernation          : 
SecurityProfile              : 
PublicNetworkAccess          : Enabled
SupportedCapabilities        : 
DataAccessAuthMode           : None
CompletionPercent            : 

Example-2:

You can execute the below Azure PowerShell command to get the properties of the specified managed disk under the specified Resource Group.

Get-AzDisk -ResourceGroupName 'DEMO1234' -DiskName 'testing'

After executing the above command, I got the expected output, as shown in the screenshot below.

Get-AzDisk

Example-3:

You can execute the Azure PowerShell command below to get the properties of all the managed disks in the specified Resource Group.

Get-AzDisk -ResourceGroupName 'DEMO1234'

After executing the above command, I got the expected output, as shown below.

Get-AzDisk PowerShell

You may also like following the articles below