BeYourself different approach

Office 365 - Granting/Revoking Permissions via PowerShell

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Alex

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:-

'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:

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.

Connecting to Office 365 Cloud Mail Server

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 username@domain.com

Add-MailboxPermission kk999999@test.com -User as366498@test.com -AccessRights "FullAccess"

After running the above script you will get confirmation displayed like below:-

Granting Permissions Successfully

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... :)

More Posts

M&A Scorecard