If you’re using Microsoft Booking in your Microsoft 365 Tenant, you might want to list all of the Booking calendars. Booking uses Exchange Online Mailboxes in the background. Every Booking Calendar has a corresponding Mailbox of the type “SchedulingMailbox”. If an user gets assigned “Administrator” for a Booking Calendar, they get “FullAccess” permissions for the Scheduling Mailbox.
List all Booking Calendars with permission#
I wrote a PowerShell script to list all the Booking Mailboxes with the users that have access.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| # prerequisite: Exchange Online v2 PowerShell module, must be connected to the service
$BookingsMailboxesWithPermissions = New-Object 'System.Collections.Generic.List[System.Object]'
# Get all Booking Mailboxes
$allBookingsMailboxes = Get-ExoMailbox -RecipientTypeDetails SchedulingMailbox -ResultSize:Unlimited
# Loop through the list of Mailboxes
$BookingsMailboxesWithPermissions = foreach($bookingsMailbox in $allBookingsMailboxes) {
# Get Permissions for this Mailbox
$allPermissionsForThisMailbox = Get-ExoMailboxPermission -UserPrincipalName $bookingsMailbox.UserPrincipalName -ResultSize:Unlimited | Where-Object {($_.User -like '*@*') -and ($_.AccessRights -eq "FullAccess")}
foreach($permission in $allPermissionsForThisMailbox) {
# Output PSCustomObject with infos to the foreach loop, so it gets saved into $BookingsMailboxesWithPermissions
[PSCustomObject]@{
'Bookings Mailbox DisplayName' = $bookingsMailbox.DisplayName
'Bookings Mailbox E-Mail-Address' = $bookingsMailbox.PrimarySmtpAddress
'User' = $permission.User
'AccessRights' = "Administrator"
}
}
}
$BookingsMailboxesWithPermissions | Export-Csv C:\temp\bookings-permissions.csv -Encoding utf8 -Delimiter ";" -NoTypeInformation
|
Example of result:
In this case, there are two Booking Mailboxes in the tenant. One of the Mailboxes has two “Administrators” assigned.
List all Booking Calendars#
If you only want to list the calendars, replace the last line of the script with the following:
1
| $BookingsMailboxesWithPermissions | Sort-Object -Property "Bookings Mailbox E-Mail-Address" -Unique | Export-Csv C:\temp\bookings-permissions.csv -Encoding utf8 -Delimiter ";" -NoTypeInformation
|