Hi
Repurposing a script I found that takes a user name and displays the AccessRights to each folder in the mailbox. There are a lots of entries that have no AccessRights ({None}), usually for the Anonymous and Default user. I want to filter out these accounts. This is what I have:
Clear-Host
Ask for an existing user
$Msg = “Enter the name of the mailbox that requires permissions changing.”
$Msg += "`nThis must be in the format of firstname lastname: "
Write-Host $Msg -ForegroundColor Green -NoNewLine
$CurrentUser = Read-Host
Define Special (System) Folders
$SpecialExchangeFolders = “Top of Information Store|Recoverable Items|Deletions|Purges|Versions”
Get the folder list for the user
[string] $FolderPaths = Get-MailboxfolderStatistics $CurrentUser | % {$_.folderpath}
Add the folder list to the users and replace / with \
$ExchangeFolderPaths = $FolderPaths | % {$CurrentUser + “:” + $_.replace(‘/’,'')}
Remove the specila folders from folder list
$UsableExchangeFolderPaths = $ExchangeFolderPaths | where { $_ -notmatch $SpecialExchangeFolders }
Display only the foldername, user and their accessrights
$UsableExchangeFolderPaths | % { get-mailboxfolderPermission $_ } | Where {$_.AccessRights -ne “{None}”}| Select-Object FolderName, Identity, AccessRights
Running this code still shows all folders and users that have no AccessRights!
Thanks
Tony