Anthony K O365
asked on
How to get the Mailbox Permission of a user
I am trying to find ALL the mailboxes a particular user has access to. I'm using the following PS:
$allmbx = Get-Mailbox -ResultSize unlimited
Foreach ($mbx in $allmbx) {
Exchange 2016
Get-MailboxPermission $_.identity -User ASmith | select identity, user, accessrights |epcsv D:\data\ASmithAccess.csv -notypeinfor
}
But I'm getting no results but I know the user has Full Access to a few mailboxes. I believe there may an issue in the 'Identity' switch. Please assist. Thanks!
$allmbx = Get-Mailbox -ResultSize unlimited
Foreach ($mbx in $allmbx) {
Exchange 2016
Get-MailboxPermission $_.identity -User ASmith | select identity, user, accessrights |epcsv D:\data\ASmithAccess.csv -notypeinfor
}
But I'm getting no results but I know the user has Full Access to a few mailboxes. I believe there may an issue in the 'Identity' switch. Please assist. Thanks!
ASKER
Without creating a loop, this will cause the script to timeout with a limitations error. Please create while looping through all mailboxes first. thanks. This is for Exchange 2016 On-Prem
Thanks again!
Thanks again!
$allmbx = Get-Mailbox -ResultSize unlimited
Foreach ($mbx in $allmbx) {
#Exchange 2016
Get-MailboxPermission $mbx.identity -User ASmith | select identity, user, accessrights |epcsv D:\data\ASmithAccess.csv -notypeinformation
}
but it's actually the same as what Saif said, but implemented in your script with a for loop.
ASKER
Unfortunately, this only produced one mailbox, but the user i.e. 'ASmith' has access to many mailboxes. Also the accessRights column shows "Microsoft.Exchange.Manage ment.Recip ientTasks. MailboxRig hts [ ]" whereas I as expecting to see 'Full Access'. Any thoughts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Team,
You've all been very helpful! What a Team!!
Thanks!
You've all been very helpful! What a Team!!
Thanks!
Get-Mailbox | Get-MailboxPermission -User xyz
List all shared/user/room/whatever mailboxes to which particular user has Full Access permissions:
Get-Mailbox -RecipientTypeDetails UserMailbox,SharedMailbox -ResultSize Unlimited | Get-MailboxPermission -User xyz
List all mailboxes to which members of a particular security group have access:
Get-Mailbox | Get-MailboxPermission -User xyz
List all mailboxes to which a user has Send As permissions:
Get-Mailbox | Get-RecipientPermission -Trustee xyz
List all user mailboxes to which members of a particular security group have Send As access:
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Get-RecipientPermission -Trustee xyz