customer relationships

PowerShell – How to Add and Remove Calendar and Contacts permission’s for Office 365 User’s via PowerShell

How to add, and remove, contacts and calendars permissions for users of Office 365 by using PowerShell. This can be useful should you have trouble trying to add permissions over Outlook.
The first you need to connect to the Office 365 Exchange Powershell, open a Powershell session and enter these commands, providing your Office 365 admin account details when requested:


$cred = Get-Credential 

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $cred -Authentication Basic –AllowRedirection 

Import-PSSession $session 



Now you can get on with the adding and removing user permissions.


Check current permissions
Before you start adding permissions, check if there are any existing permissions on the folder first. If a user already has permissions for another user’s contacts/calendar folder then you won’t be able to change them until the permissions are removed. To do this, type in the following code:


Get-MailboxFolderPermission -Identity\Calendar| Select User, AccessRights, Deny



Change with which ever user you want to view. Also Calendar can be changed for Contacts if you want to view who has access to the contacts folder.


Once you’ve chosen the permissions you wish to give the user you can add the permissions using PowerShell. Use to following code to do this:


Add-MailboxFolderPermission -Identity\Calendar -AccessRights [Permission goes here] -User 


Replace the with the mailbox you want to add permissions to and to the mailbox you want to have access. Also change [Permission goes here] to whatever permission you wish to use from the list above.


Remove Permissions
Lastly, if you want to remove some permissions then you can use this line of code:

Remove-MailboxFolderPermission -Identity\Calendar -User



best vpn deal

Leave a Reply

Your email address will not be published. Required fields are marked *