Skip to content

Instantly share code, notes, and snippets.

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 PlagueHO/5900d92a9b97e947bc60ff7fe721fefe to your computer and use it in GitHub Desktop.
Save PlagueHO/5900d92a9b97e947bc60ff7fe721fefe to your computer and use it in GitHub Desktop.
Assign List and Get policy to a user in Azure Key Vault if the UPN is not known
$userObjectId = (Get-AzureRmADUser -SearchString 'Joe Bloggs').Id
Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ResourceGroupName $resourceGroupName `
-ObjectId $userObjectId `
-PermissionsToCertificates list,get `
-PermissionsToKeys list,get `
-PermissionsToSecrets list,get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment