Increase speed of permission acquisition

This commit is contained in:
2022-08-26 14:10:42 +02:00
parent acb5cfaf64
commit b52176cbdd
3 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<##
# EXCAL-ARIGHTS - utilities function
#
# @version 1.1.0
# @version 1.1.1
# @since 08-26-2022
#
# @author Jérémi Nihart <contact@endmove.eu>
@@ -35,14 +35,14 @@ Function DisplayAll {
[string[]]$CalandarFolders
)
$Users = Get-EXOMailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox
Write-Host ("[$ScriptName] We found " + $Users.count + " users") -BackgroundColor White -ForegroundColor Black
Write-Host ("[$ScriptName] We found " + $Users.count + " user mailboxes") -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
$CurrCalPerms = Get-EXOMailboxFolderPermission -Identity $CurrCalId
foreach ($CurrCalPerm in $CurrCalPerms) {
Write-Host ($CurrCalPerm.User.ToString() +" : " + $CurrCalPerm.AccessRights)