Thank you for your post and I apologize for the delayed response!
When it comes to getting a list of all your Azure Key Vault Managed HSMs both in an active or deleted state (not purged), you can leverage the Az.KeyVault PowerShell commands.
-
Note: You can run these commands from Azure Cloud Shell or from Azure PowerShell on your desktop.
Get all managed HSMs in your current subscription:
Get-AzKeyVaultManagedHsm
Name Resource Group Name Location SKU ProvisioningState Security Domain ActivationStatus
---- ------------------- -------- --- ----------------- --------------------------------
myhsm test-rg eastus StandardB1 Succeeded Active
Get-AzKeyVaultManagedHsm -InRemovedState
Name Location DeletionDate ScheduledPurgeDate Purge Protection Enabled?
---- -------- ------------ ------------------ -------------------------
xxxxxxxx-mhsm-4op2n2g4xe eastus2 12/30/2021 2:29:00 AM 3/30/2022 2:29:00 AM True
xxxxxxx-mhsm-ertopo7tnxa westus 12/29/2021 11:48:42 PM 3/29/2022 11:48:42 PM True
xxxxxxx-mhsm-gg66fgctz67 westus 12/29/2021 11:48:42 PM 3/29/2022 11:48:42 PM False
xxxxxxx-mhsm-2m5jiop6mfo westcentralus 12/30/2021 12:26:14 AM 3/30/2022 12:26:14 AM True
To check the status of soft-delete and purge protection for a managed HSM:
Get-AzKeyVaultManagedHsm -Name "ContosoHSM"
Additional Links:
- Get started with Azure Cloud Shell
- Install Azure PowerShell on Windows
- Managed HSM soft-delete and purge protection
- Managed HSM disaster recovery
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.