<## # EXCAL-ARIGHTS - utilities function # # @version 1.1.0 # @since 08-26-2022 # # @author Jérémi Nihart # @copyright © 2022 EndMove, All rights reserved. # # @link https://git.endmove.eu/EndMove/excal-arights #> # Show a question dialog (yes/no) Function DialogAsk { param ( [string]$Title, [string]$Message ) $MsgBoxInput = [System.Windows.MessageBox]::Show($Message, $Title, 'YesNo', 'Question') if ($MsgBoxInput -eq 'Yes') {Return $true} else {Return $false} } # Show an information dialog Function DialogSay { param ( [string]$Title, [string]$Message ) [System.Windows.MessageBox]::Show($Message, $Title, 'OK', 'Information') } # Show current permissions for all user's calandars Function DisplayAll { param ( [string[]]$CalandarFolders ) $Users = Get-EXOMailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox Write-Host ("[$ScriptName] We found " + $Users.count + " users") -BackgroundColor White -ForegroundColor Black foreach ($User in $Users) { Write-Host $User.Name -BackgroundColor DarkGreen $Calandars = Get-EXOMailboxFolderStatistics $User.Identity -FolderScope Calendar | Where-Object {$_.Name -in $CalandarFolders} foreach ($Calandar in $Calandars) { Write-Host $Calandar.Name.ToString() -BackgroundColor DarkMagenta $CurrCalId = $User.Identity.ToString() + ":\" + $Calandar.Name.ToString() $CurrCalPerms = Get-MailboxFolderPermission -Identity $CurrCalId foreach ($CurrCalPerm in $CurrCalPerms) { Write-Host ($CurrCalPerm.User.ToString() +" : " + $CurrCalPerm.AccessRights) } } Write-Host } }