The purpose of the script is to get for each folder granted permissions for given mailboxes.
#run the script against a single mailbox
.\Get-MailboxFolderPermissionEWS.PS1 -EmailAddress trick@adatum.com
#pipe all the mailboxes on database USEX01-DB01 into the script
Get-Mailbox -Database USEX01-DB01 -ResultSize unlimited | .\Get-MailboxFolderPermissionEWS.PS1
#pipe all the mailboxes on database USEX01-DB01 into the script and use 10 threads
Get-Mailbox -Database USEX01-DB01 -ResultSize unlimited | .\Get-MailboxFolderPermissionEWS.PS1 -Threads 10 -MultiThread
#pipe all the mailboxes on database USEX01-DB01 into the script and use 10 threads
Get-Mailbox -Database USEX01-DB01 -ResultSize unlimited | .\Get-MailboxFolderPermissionEWS.PS1 -Threads 10 -MultiThread
#same as the previous, but this time using different credentials and impersonate
$SA= Get-Credential adatum\serviceaccount
Get-Mailbox -Database USEX01-DB01 -ResultSize unlimited | .\Get-MailboxFolderPermissionEWS.PS1 -Threads 10 -MultiThread -Server ex01.adatum.com -UseDefaultCred 0 -Impersonate -Credentials $SA
#to export the result just use the Export-CSV CmdLet
Get-Mailbox -Database USEX01-DB01 -ResultSize unlimited | .\Get-MailboxFolderPermissionEWS.PS1 | Export-Csv -NoTypeInformation -Path .\result.csv
#scan multiple mailboxes for invalid permission entries using ApplicationImpersonation, give credentials and multithreading
Get-MailboxDatabase dee16dag01* | Get-Mailbox -ResultSize Unlimited | .\Get-MailboxFolderPermissionEWS.PS1 -Impersonate -Credentials $cred -MultiThread -SearchUnknownOnly
The e-mail address of the mailbox, which will be checked. The script accepts piped objects from Get-Mailbox or Get-Recipient.
Credentials you want to use. If omitted current user context will be used.
Use this switch, when you want to impersonate.
By default the script will enumerate all folders. If you want to limit to folders with type "IPF.Appointment" use this switch.
From where you want to start the search for folders. Default is "MsgFolderRoot". Other posible value is "Root".
By default the script tries to retrieve the EWS endpoint via Autodiscover. If you want to run the script against a specific server, just provide the name in this parameter. Not the URL!
How many threads will be created. Be careful as this is really CPU intensive! By default 10 threads will be created. I limit the number of threads to 20.
If you want to run the script multi-threaded use this switch. By default the script don't use threads.
The timeout for a job, when using multi-threads. Default is 240 seconds.
The path to MrMapi.exe. Only full path is accepted!
Switch to tell the script to use MrMapi or not.
Switch to trust any certificate.
Returns only folders with invalid permissions.
Will remove UnknownEntries using SOAP