Script repository
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.