Last active
February 21, 2024 11:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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