Adding and Removing Calendar Permissions in Office 365 with PowerShell

Right then! More PowerShell shenanigans and this one is more by necessity rather than simply ‘doing it because you can’ as (correct me if I’m wrong) there’s no way to do this in the GUI/Admin Center.

So, nice and simple really this one. As before in the last post, you’ll need to connect to your Office365 environment first before typing any commands and you can do this by running the following lines of code:

> Connect-ExchangeOnline
This is the new way to connect to Exchange online, no more need for the convoluted method from before!

Then, once you’ve done that

> Add-MailboxFolderPermission -Identity user1@yourworkplace.com:\calendar -user user2@yourworkplace.com -AccessRights Editor
This adds USER2 to the permission set for USER1 with the access rights of editor.

And to remove (somewhat obviously)

> Remove-MailboxFolderPermission -Identity user1@yourworkplace.com:\calendar -user user2@yourworkplace.com
This removes USER2 to the permission set for USER1 (without the access level tag)

That’s it! Then end your session by running the following command:

> Remove-PSSession $Session
This will end the connection to the O365 environment.

All done!

Richard

30-something Sysadmin from the Midlands, UK.