Hi all,
I’ve ran in this issue as well, but I’ve found a wonderful script that checks every user, sets calendar permissions for every user in that organization, can exclude users and has multi calendar languages
The script is from: https://www.alitajran.com/set-default-calendar-permissions-for-all-users-powershell/
<#
.SYNOPSIS
Set-DefCalPermissions.ps1
.DESCRIPTION
Set default calendar permissions for all user mailboxes including exception for users.
The script works for:
-Exchange On-Premises (Run Exchange Management Shell)
-Exchange Online (Connect to Exchange Online PowerShell)
.LINK
alitajran.com/set-default-calendar-permissions-for-all-users-powershell
.NOTES
Written by: ALI TAJRAN
Website: alitajran.com
LinkedIn: linkedin.com/in/alitajran
.CHANGELOG
V1.00, 02/28/2021 - Initial version
V1.10, 03/29/2023 - Changed Exceptions to look for UserPrincipalName
#>
Start transcript
Start-Transcript -Path "C:\temp\Set-DefCalPermissions.log" -Append
Set scope to entire forest. Cmdlet only available for Exchange on-premises.
#Set-ADServerSettings -ViewEntireForest $true
Get all user mailboxes
$Users = Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox
Users exception (add the UserPrincipalName)
$Exception = @("@exoip.com", "@exoip.com")
Permissions
$Permission = "LimitedDetails"
Calendar name languages
$FolderCalendars = @("Agenda", "Calendar", "Calendrier", "Kalender", "日历")
Loop through each user
foreach ($User in $Users) {
# Get calendar in every user mailbox
$Calendars = (Get-MailboxFolderStatistics $User.UserPrincipalName -FolderScope Calendar)
# Leave permissions if user is exception
if ($Exception -Contains ($User.UserPrincipalName)) {
Write-Host "$User is an exception, don't touch permissions" -ForegroundColor Red
}
else {
# Loop through each user calendar
foreach ($Calendar in $Calendars) {
$CalendarName = $Calendar.Name
# Check if calendar exist
if ($FolderCalendars -Contains $CalendarName) {
$Cal = "$($User.UserPrincipalName):$CalendarName"
$CurrentMailFolderPermission = Get-MailboxFolderPermission -Identity $Cal -User Default
# Set calendar permission / Remove -WhatIf parameter after testing
Set-MailboxFolderPermission -Identity $Cal -User Default -AccessRights $Permission
# Write output
if ($CurrentMailFolderPermission.AccessRights -eq "$Permission") {
Write-Host $User.DisplayName already has the permission $CurrentMailFolderPermission.AccessRights -ForegroundColor Yellow
}
else {
Write-Host $User.DisplayName added permissions $Permission -ForegroundColor Green
}
}
}
}
}
Stop-Transcript
It helped me so I hope it will help you to!