Modify the O365 Mailbox Calendar sharing for a single individual or the entire organization. Very handy to allow everyone to see a single calendar or everyone’s calendar.

Technical Details

The provided script performs the following tasks:

  1. Retrieves a list of user mailboxes using the `Get-Mailbox` cmdlet and filters for mailboxes with the recipient type “UserMailbox”. The result is stored in the variable `$Users`.
  2. It then iterates through each user mailbox using a `ForEach` loop, where each mailbox is represented by the variable `$User`.
  3. Inside the loop, it constructs the path to the user’s calendar folder by concatenating the user’s alias (a unique identifier for the mailbox) with the string `”:\Calendar”`. The resulting path is stored in the variable `$Calendar`.
  4. Finally, it sets the mailbox folder permission for the calendar folder using the `Set-MailboxFolderPermission` cmdlet. It specifies the identity of the calendar folder as `$Calendar`, sets the user to “Default” (which represents the default permission group), and grants them “LimitedDetails” access rights.

In summary, the script retrieves a list of user mailboxes, iterates through each mailbox, and grants the “Default” user limited access to the calendar folder of each mailbox.

The Script

Modify Calendar Detail Sharing for entire org:

$Users = Get-Mailbox -RecipientTypeDetails UserMailbox
ForEach($User in $Users){
$Calendar = $user.alias+”:\Calendar”
Set-MailboxFolderPermission -Identity $Calendar -User Default -AccessRights LimitedDetails}

Modify Calendar Detail Sharing for single mailbox:

Set-MailboxFolderPermission -Identity [user_id]:\Calendar -User Default -AccessRights LimitedDetails

********************