How do I get sum of GBs used by Storage Accounts in Microsoft Azure?

In case you need to get sum of GBs used by all Storage Accounts created in Microsoft Azure, use below series of PowerShell commands.

  • $BlobVHDsSize=Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob | Measure-Object Length -Sum | select-object sum
  • $TotalGBUsed = $BlobVHDsSize.Sum/1024/1024/1024
  • Write-Host $TotalGBUsed “GB”  

First command gets all blobs created in Microsoft Azure. Second command converts bytes to GB.

Note: You must install Azure PowerShell cmdlets Version 1.0 before you use above cmdlet. 

 

About Nirmal Sharma

Nirmal Sharma is a MCSEx3, MCITP and Microsoft MVP in Directory Services. He specializes in directory services, Microsoft Azure, Failover clusters, Hyper-V, and System Center products and has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to Health Packs for ADHealthProf.ITDynamicPacks.Net solutions. Nirmal can be reached at [email protected].

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top