# Permissions
Permissions can be tricky with calendars, thankfully they can be managed centrally by connecting to [[Exchange Online PowerShell]]. You can also set the Default user permissions.
## Permission Levels
The following table lists the possible values for the **CalendarPermissionLevel** element.^[[CalendarPermissionLevel | Microsoft Learn](https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/calendarpermissionlevel)]
|**Value**|**Description**|
|---|---|
|None|Indicates that the user has no permissions on the folder.|
|Owner|Indicates that the user can create, read, edit, and delete all items in the folder, and create subfolders. The user is both folder owner and folder contact.|
|PublishingEditor|Indicates that the user can create, read, edit, and delete all items in the folder, and create subfolders.|
|Editor|Indicates that the user can create, read, edit and delete all items in the folder.|
|PublishingAuthor|Indicates that the user can create and read all items in the folder, edit and delete only items that the user creates, and create subfolders.|
|Author|Indicates that the user can create and read all items in the folder, and edit and delete only items that the user creates.|
|NoneditingAuthor|Indicates that the user can create and read all items in the folder, and delete only items that the user creates.|
|Reviewer|Indicates that the user can read all items in the folder.|
|Contributor|Indicates that the user can create items in the folder. The contents of the folder do not appear.|
|FreeBusyTimeOnly|Indicates that the user can view only free/busy time within the calendar.|
|FreeBusyTimeAndSubjectAndLocation|Indicates that the user can view free/busy time within the calendar and the subject and location of appointments.|
|Custom|Indicates that the user has custom access permissions on the folder.|
## Get Permissions
Use the Get-MailboxPermission cmdlet to retrieve permissions on a mailbox.^[[Get-MailboxPermission (ExchangePowerShell) | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/exchange/get-mailboxpermission?view=exchange-ps)]
```PowerShell
Get-MailboxFolderPermission -Identity "
[email protected]"
```
## Grant Permissions
If no permission exists then you can use the `Add-MailboxFolderPermission`^[[Add-MailboxFolderPermission (ExchangePowerShell) | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/exchange/add-mailboxfolderpermission?view=exchange-ps)], otherwise to update an existing permission you can use `Set-MailboxFolderPermission`^[[Set-MailboxFolderPermission (ExchangePowerShell) | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/exchange/set-mailboxfolderpermission?view=exchange-ps)].
```PowerShell
Set-MailboxFolderPermission -Identity "
[email protected]" -User Default -AccessRights Reviewer
```
## Script to add/set user permissions for multiple calendars
```PowerShell
# Prompt the script runner for the user email
$user = Read-Host "Enter the email address of the user to grant permissions to"
# Define the calendars you want to modify
$calendars = @(
"
[email protected]:\Calendar", # Replace with mailbox and folder path of the calendar
"
[email protected]:\Calendar",
"
[email protected]:\Calendar",
"
[email protected]:\Calendar",
"
[email protected]:\Calendar",
)
# Define the permissions you want to apply (can be: Reviewer, Editor, PublishingEditor, etc.)
$permission = "Editor" # Replace with the desired permission (e.g., Reviewer, Editor, etc.)
# Loop through each calendar and set permissions for the user
foreach ($calendar in $calendars) {
try {
# Check if permission already exists and set it, or add permission if not
$existingPermission = Get-MailboxFolderPermission -Identity $calendar -User $user -ErrorAction SilentlyContinue
if ($existingPermission) {
# If permission exists, update it
Set-MailboxFolderPermission -Identity $calendar -User $user -AccessRights $permission
Write-Host "Updated permissions for $user on calendar $calendar"
} else {
# If no permission exists, add it
Add-MailboxFolderPermission -Identity $calendar -User $user -AccessRights $permission
Write-Host "Added permissions for $user on calendar $calendar"
}
}
catch {
Write-Host "Error adding/updating permissions for $user on calendar ${calendar}: $_"
}
}
```