Script repository

Check if a specific permission is granted to entire organization over user calendar

Updated on: Jan 18, 2026, Views: 1284

Exchange

The script returns $true if a specific permission is granted to the entire organization over user calendar. To execute the script, use the If PowerShell script returns true condition in a business rule, custom command or scheduled task configured for the User object type.

In the script, the $accessRight variable specifies the permission to check. For allowed values, see ADM_EXCHANGE_CALENDAR_RIGHT_ENUM.

$accessRight = "ADM_EXCHANGE_CALENDAR_RIGHT_AVAILABILITYONLY" # TODO: modify me

$Context.ConditionIsMet = $False
$user = $Context.BindToObject($Context.TargetObject.AdsPath)
$mailboxParams = $user.GetMailParameters()
$calendarPermissions = $mailboxParams.CalendarPermissions
foreach ($permission in $calendarPermissions)
{
    if ($permission.Value.Trustee.ObjectSid -ne "S-1-5-15")
    {
        continue
    }

    $Context.ConditionIsMet = $permission.Value.AccessRight -eq $accessRight
    break
}

Comments 0

You must be signed in to comment.

    Got questions?

    Support Questions & Answers

    We use cookies to improve your experience.
    By your continued use of this site you accept such use.
    For more details please see our privacy policy and cookies policy.