Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

This cmdlet will query all mailboxes in Exchange and determine who the specified user has calendar permissions for. Has 2 options - VerboseMode and ReportMode.

  • VerboseMode will ouput the results to GridView
  • ReportMode will output the results to CSV

Both modes can be used simultaneously.

Edit $OutputPath to specify the CSV Output location.

   Get-CalendarPermissions - Queries all mailboxes to determine who the specified user has access for 
   .\Get-CalendarPermissions -User palacia -VerboseMode 
   .\Get-CalendarPermissions -User palacia -ReportMode -VerboseMode 
   Alias or UserName to query all mailboxes against 
    Written by Jeremy Corbello 
    V1.0 - 7/10/2017 
param ( 
$OutputPath = "C:\temp\CalendarPermissions$(Get-Date -f 'MMddyy').csv" 
#Add Exchange snapin if not already loaded in the PowerShell session 
if (Test-Path $env:ExchangeInstallPath\bin\RemoteExchange.ps1) 
    . $env:ExchangeInstallPath\bin\RemoteExchange.ps1 
    Connect-ExchangeServer -auto -AllowClobber 
    Write-Host "Established Remote Exchange Session" 
    Write-Warning "Exchange Server management tools are not installed on this computer." 
$Report = @() 
    $Mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"}  
    $i = 1 
   ForEach ($Mailbox in $Mailboxes)  
       $Calendar = $Mailbox.PrimarySmtpAddress.ToString() + ":\Calendar" 
       #$Inbox = $Mailbox.PrimarySmtpAddress.ToString() + ":\Inbox" 
       $Permissions = Get-MailboxFolderPermission -Identity $Calendar |  where-object {$_.User -like "$User" -and $_.AccessRights –notlike “None”}  
       Write-Progress -Activity "Scanning Mailboxes" -Status "$i out of $($Mailboxes.count)" -percentComplete ($i/$Mailboxes.count*100) 
      foreach ($Permission in $Permissions)  
  $permission | Add-Member -MemberType NoteProperty -Name "Calendar" -value $Mailbox.DisplayName 
  $Report = $Report + $permission 
if ($VerboseMode) { 
    $Report | Select-Object Calendar,User,@{label="AccessRights";expression={$_.AccessRights}} | Out-GridView -PassThru 
if ($ReportMode) { 
    $Report | Select-Object Calendar,User,@{label="AccessRights";expression={$_.AccessRights}} | Export-Csv -Path $OutputPath -NoTypeInformation