Find all Exchange mailboxes a list of users have access to with PowerShell

To find all Exchange mailboxes a list of users have access to put the mailboxes in a TXT file. One mailbox per line, e.g.:

myname@domain.com
mynewname@domain.com

etc.

Save the file as 'users.txt' and put the file on your desktop.

Run this code to create a TXT file with all the mailboxes a user has access to:


Get-Mailbox | Get-MailboxPermission -User $line | Select-Object Identity,User,AccessRights | ft -AutoSize | Tee-Object C:\users\$env:UserName\desktop\mailboxesUsersHasAccessTo.txt -Append
}

Kommentarer

Populære opslag fra denne blog

Microsoft Office 2016 and the AUTO_ACTIVATE property

Access Exchange online with Office 365 multi-factor authentication (MFA/2FA)

Disable logon and logoff events (event id 4624, 4625, 4634 (and all the other ones...))