Skip to content

Instantly share code, notes, and snippets.

@jayankandathil
Last active February 21, 2024 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jayankandathil/86a57e24d1c6f0a5fc88beef68f95bb1 to your computer and use it in GitHub Desktop.
Save jayankandathil/86a57e24d1c6f0a5fc88beef68f95bb1 to your computer and use it in GitHub Desktop.
PowerShell script to output all [Data Store] Blobs in AEM Azure Blob Storage
<#
.SYNOPSIS
List all AEM [Data Store] Blobs to a CSV file
.DESCRIPTION
This PowerShell script was tested with Azure PowerShell v4.3.1
.NOTES
AUTHOR: Jayan Kandathil (Adobe AEM Managed Services)
LASTEDIT: August 19, 2017
#>
Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionName "Your AEM subscription name"
# Set default storage account
Set-AzureRmCurrentStorageAccount -Name "youraemblobstorageaccount" -ResourceGroupName "your-resourcegroup-name"
$ErrorActionPreference = 'Stop'
Write-Host -foregroundcolor Yellow "Getting AEM [Data Store] Blob List..."
$Watch = [System.Diagnostics.Stopwatch]::StartNew()
# List all blobs in the container
Get-AzureStorageBlob -Container "youraemblobcontainer" | Sort-Object Name | Select-Object Name,Length,LastModified,SnapshotTime | Export-Csv -Encoding UTF8 -Path G:\TEMP\list_of_blobs.csv
$Watch.Stop()
Write-Host -foregroundcolor Yellow "Done."
Write-Host -foregroundcolor Yellow "Took $($Watch.Elapsed.TotalSeconds) seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment