Get-AzStorageAccount

Gets a Storage account.

Syntax

Get-AzStorageAccount
   [[-ResourceGroupName] <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzStorageAccount
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-IncludeGeoReplicationStats]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzStorageAccount
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-IncludeBlobRestoreStatus]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzStorageAccount cmdlet gets a specified Storage account or all of the Storage accounts in a resource group or the subscription.

Examples

Example 1: Get a specified Storage account

PS C:\>Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount"

This command gets the specified Storage account.

Example 2: Get all Storage accounts in a resource group

PS C:\>Get-AzStorageAccount -ResourceGroupName "RG01"

This command gets all of the Storage accounts in a resource group.

Example 3: Get all Storage accounts in the subscription

PS C:\>Get-AzStorageAccount

This command gets all of the Storage accounts in the subscription.

Example 4: Get a Storage accounts with its blob restore status

PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -IncludeBlobRestoreStatus

PS C:\> $account.BlobRestoreStatus

Status     RestoreId                            FailureReason Parameters.TimeToRestore     Parameters.BlobRanges                 
------     ---------                            ------------- ------------------------     ---------------------                 
InProgress a70cd4a1-f223-4c86-959f-cc13eb4795a8               2020-02-10T13:45:04.7155962Z [container1/blob1 -> container2/blob2]

This command gets a Storage accounts with its blob restore status, and show the blob restore status.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeBlobRestoreStatus

Get the BlobRestoreStatus of the Storage account.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeGeoReplicationStats

Get the GeoReplicationStats of the Storage account.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the Storage account to get.

Type:String
Aliases:StorageAccountName, AccountName
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group that contains the Storage account to get.

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

Inputs

String

Outputs

PSStorageAccount