The Remove-MsolRoleMember command in PowerShell removes a member from an administrator role in Microsoft Office 365.
The syntax to remove a member from an administrator role is given below.
Remove-MsolRoleMember
-RoleObjectId <Guid>
-RoleName <String>
[-RoleMemberType <RoleMemberType>]
[-RoleMemberObjectId <Guid>]
[-RoleMemberEmailAddress <String>]
[-TenantId <Guid>]
[<CommonParameters>]
In this article, we will discuss how to use the Remove-MsolRoleMember command in PowerShell to remove a member from an administrator role in Azure Active Directory.
How to Remove a Member from an Administrator Role in Office 365
To remove a member from an Administrator role in Office 365, use the Remove-MsolRoleMember command with the -RoleName
and -RoleMemberEmailAddress
parameter.
The -RoleName
parameter specifies the name of the role from which to remove members. The -RoleMemberEmailAddress
parameter specifies the email address of the member to remove.
Remove-MsolRoleMember -RoleName "User Administrator" -RoleMemberType User -RoleMemberEmailAddress "[email protected]"
This command removes the user with the email address “[email protected]” from the “User Administrator” role. You can use the Get-MsolRole command to get the list of the values for the role.
Conclusion
I hope the above article on how to use the Remove-MsolRoleMember cmdlet in Powershell to remove a member from an administrator role is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.