Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Remove a role using PowerShell from Azure AD
April 24, 2016
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).SubscriptionIdGet-AzureRmRoleAssignmentRemove-AzureRmRoleAssignment -ObjectId "bc197389-c82d-48d7-a0e6-8e4cfc0861fc" -RoleDefinitionName "Website Contributor" -Scope $subGUID
You May Also Like