To add a user to a specific role in Exchange Online an easy way to do this is to use the Office365 GUI. However, this is by far not a fast way. Especially when adding and removing users to and from a group is a day to day effort. In that case, you’d better give Powershell a try.
First, make you sure you have downloaded and installed the Microsoft Exchange Online Powershell Module. You can download it from your Admin Center in Office 365 Exchange Online.
Then, in your Powershell session, to get a list of available roles, type:
Get-RoleGroup
Then, to get the members of a role group, type:
Get-RoleGroupMember
Then, to add a user to the role group quickly, type:
Add-RoleGroupMember -Identity "Impersonate Role" -Member upn_of_user@yourcompany.com #High risk. Add user to Impersonate Role only for scripts and service accounts Add-RoleGroupMember -Identity "View-Only Organization Management" -Member upn_of_user@yourcompany.com #add user to View Only Organization Management
Well, this is propably not the most indepth post I’ve ever written 🙂 , but it’s a good reference for further scripts.
This allows me to automate much more Admin roles in Exchange Online, like:
Organization Management
Recipient Management
View-Only Organization Management
UM Management
Help Desk
Records Management
Discovery Management
Hygiene Management
Compliance Management
Security Reader
Security Administrator
TenantAdmins
HelpdeskAdmins
RIM-MailboxAdmins
ExchangeServiceAdmins
Address List Management
Impersonate Role