Skip to content

Instantly share code, notes, and snippets.

@alanta
Created January 31, 2020 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanta/6f4fa5dbdd25372a16ba6915282d004f to your computer and use it in GitHub Desktop.
Save alanta/6f4fa5dbdd25372a16ba6915282d004f to your computer and use it in GitHub Desktop.
param ([Parameter(Mandatory)]$keyvaultname)
$userid = az ad signed-in-user show --query objectId
if($LASTEXITCODE){
Write-Information "Please login using 'az login' and make sure you select the correct subscription with 'az account'"
}
az keyvault set-policy -n $keyvaultname --secret-permissions backup delete get list purge recover restore set --object-id $userid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment