Increase speed of permission acquisition
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user