I recently had to make some bulk changes to calendar permissions in Office 365, the client wanted the Default user permission to be set to Reviewer rather than AvailabilityOnly. So in this post I’ll walk you through how I went about making bulk permission changes to the Default user for the calendar folder for all users in Office 365.
1. Sign into Office 365 PowerShell, I’ve already blogged about how to do this, so follow the instructions at this link: How to connect to and manage Office365 using PowerShell
2. Once connected to PowerShell, let’s start by seeing how many mailboxes we are dealing with.
Type Get-Mailbox to list current mailboxes.
So we are working with about 30 mailboxes.
3.Next let’s take a look at the calendar permissions on one of the mailboxes.
Type Get-MailboxFolderPermission username:\calendar
So you can see the Default user permission is currently set to AvailabilityOnly.
Now let’s combine the two commands and check the Calendar permissions for each user.
4. Type Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:\calendar”} | Select Identity, FolderName, User, AccessRights
Here we piped the Get-Mailbox cmdlet to the Get-MailboxFolderPermission cmdlet and using $_ are able to check the calendar folder for each mailbox. By using the Select cmdlet, I am able to include the Identity field. If you look at the image in part three above the default fields are FolderName, User, and AccessRights. You can run the command Get-MailboxFolderPermission username:\calendar | Format-List to view available fields.
5. This is good as it is showing us all the calendar permissions, but let’s refine the search using Where cmdlet so we only retrieve the results for Default user.
Type Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:\calendar”} | Where {$_.User -like “Default”} | Select Identity, FolderName, User, AccessRights
So out of all the accounts there are only 5 mailboxes that need the permissions changed, the rest have already been done. We also have a couple of mailboxes where the calendar folder can’t be found. We’ll ignore these as they are outside the scope of this article.
6. Now let’s change the Default user permission for the calendar folder. Instead of using Get-MailboxFolderPermission to check the permissions, we’ll use Set-MailboxFolderPermission to modify the existing permission. If you want to give a new user permissions to a calendar you would use Add-MailboxFolderPermission.
Type Get-Mailbox | ForEach-Object {Set-MailboxFolderPermission $_”:\calendar” -User Default -AccessRights Reviewer}
As you can see the output of the command shows us any errors and warnings.
7. Now let’s check the permissions are correct. We’ll use the same command as in step 5.
Type Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:\calendar”} | Where {$_.User -like “Default”} | Select Identity, FolderName, User, AccessRights
So the end result is all users have the Default user permission of their calendar folder set to Reveiwer.
Resources:
Related Posts:
1. How to connect to and manage Office365 using PowerShell
3. Exchange 2013 Initial Configuration Settings
4. How to install Exchange 2013 (SP1) on Windows Server 2012 R2
5. Office 365 / Exchange: Stop Display Name Spoofing
Just a quick message to say thank you for your guide – it works really well, and solves the annoying issue of new users having ‘availability only’ permissions!
Thanks! Very helpful information.
Im just trying to exclude the Rooms and Shared mailboxes, or in other words, I only want to list user mailboxes. Can you help me achieve this?