Morning all,
I am looking for a command or script that will allow me to export a csv showing the mailbox in one column, then in the next column(s) show names of the users that have access to said mailbox.
I've been trying to alter this one that I found online, with no luck, the User field is blank:
$a = Get-Mailbox -ResultSize Unlimited
$a | Get-MailboxPermission | Where { ($_.IsInherited -eq $False) -and -not ($_.User -like “NT AUTHORITY\SELF”) -and -not ($_.User -like '*Discovery Management*') } | Select Identity,@{name="User";expression={(Get-User $_.User).User}},AccessRights | Export-CSV c:\Temp\output.csv -NoTypeInformation