This entry explains how to both grant and revoke permissions in the Office 365 Cloud via PowerShell.
You will need to do the following, in order:-
- Download (If you havent already 'Microsoft Online Services Module for Windows PowerShell')
- Connect to the Office 365 Cloud
- Apply the desired permissions
Microsoft Online Services Module for Windows PowerShell
This interface is available through a PowerShell Module available from:-
- Microsoft Online Services Module for Windows PowerShell 32-bit
- Microsoft Online Services Module for Windows PowerShell 64-bit
'The Microsoft Online Services Sign-In Assistant 7.0' is a prerequisite for installing the Microsoft Online Services Module for Windows PowerShell, and is available from here:
- Microsoft Online Services Sign-In Assistant 32-bit
- Microsoft Online Services Sign-In Assistant 64-bit
Connecting to the Office 365 Cloud
Replace my e-mail address with your own (must have correct permissions to connect successfully). A dialog box will ask you to authenticate yourself, enter your password and let PowerShell connect to the Cloud.
Applying the Correct Permissions
Full Rights Access
e.g. the process to grant Alex Small full access to Kleo Kleanthous
You must specify the mailbox you want to grant access to first, then then the user second. You must also apply the permissions using the mailbox User Principle Name (UPN), which is firstname.lastname@example.org
Add-MailboxPermission email@example.com -User firstname.lastname@example.org -AccessRights "FullAccess"
After running the above script you will get confirmation displayed like below:-
Note: If you apply full access permissions via PowerShell, the mailbox should appear in the users Outlook automatically (this feature is called Auto-Mapping).
Send As Permission
add-RecipientPermission Mailbox@test.com -AccessRights SendAs -Trustee UserWhoNeedsSendAsPermission@test.com -Confirm:$False
Send On Behalf Of Permission
Set-Mailbox -Identity Mailbox@harrods.com -GrantSendOnBehalfTo UserWhoNeedsSendOnBehalfPermission@test.com
Note: If for whatever reason you need to remove permissions from a user, simply replace the ‘Add-Permission’ cmdlet with ‘Remove-Permission’.
Good luck granting and revoking your permissions... :)