FAQ: Remove a role using PowerShell

FAQ: Remove a role using PowerShell

Q. How can I remove a role from a user or group using PowerShell?

A. To remove a role from a user or group using PowerShell the process is the same as for the assignment of a role except the Remove-AzureRmRoleAssignment cmdlet is used instead of New-AzureRmRoleAssignment cmdlet. For example:

$subGUID = "/subscriptions/" + (Get-AzureRmSubscription).SubscriptionId
Get-AzureRmRoleAssignment
Remove-AzureRmRoleAssignment -ObjectId "bc197389-c82d-48d7-a0e6-8e4cfc0861fc" -RoleDefinitionName "Website Contributor" -Scope $subGUID 

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish