We are trying to write a script that will go through all mailboxes or all mailboxes in a database to find out which mailboxes a certain user has Calendar access rights to. Just can't seem to display the mailbox along with the access rights.
$User = Get-Mailbox -Database "" -ResultSize Unlimited
$User | ForEach {Get-MailboxFolderPermission -identity "$($_.PrimarySmtpAddress):\Calendar"} | Where {$_.User.ToString() -eq "Test, User"} | FT $User,Folder,AccessRights
The output is missing the mailbox that is queried. How can we get that included in the output as