This script makes use of "Get-AzureRmRoleAssignment" to export RBAC of all subscriptions matching its paramter in the current tenant. The export is stored in XML format using Export-Clixml so it can be easily re-imported later.
.\Backup-AzureSubscriptions.ps1 [-SubscriptionName <string>] [<CommonParameters>]
Name | Type | Mandatory | Description |
---|---|---|---|
SubscriptionName | String | No | Subscription Name or wildcard to export certain subscriptions only |
It creates "Subscriptions.xml" in the same location as the script is being executed from.
Export all subscription containing the word "PROD" in their name
.\Backup-AzureSubscriptions.ps1 -SubscriptionName "*PROD*"
Export all subscriptions
.\Backup-AzureSubscriptions.ps1