How to Check What Shared Mailboxes a User has Access to via Exchange 2010 Power Shell

I need to run a power shell script that allows me to see what shared mailboxes a particular user has access to.  I have tried running the cmdlet below but its not working.  Im using Exchange 2010.

Get-Mailbox | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | ft Id*

I change the domain\user to replicate my domain and users alias.

Is there any other power shell i can use to pull of what i need?

 

July 3rd, 2015 5:43am

Check the below link which has details how to extract those information from the Mailboxes

http://exchangeserverpro.com/list-users-access-exchange-mailboxes/

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2015 6:27am

Hi

Thanks for the response.  I have checked this but this does not give me the details i require.  The problem is i do not know the name of the shared mailbox the user has access to.  I only know the name and alias of the user.  So i need to search which shared mailbox this particular user has access to?

Thanks

July 3rd, 2015 7:43am

Hi,

To get the shared mailbox list, we can use the condition RecipientTypeDetails to filter out. Try something like this:

Get-Mailbox | ?{($_. RecipientTypeDetails eq sharedmailbox)} |Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | ft Id*

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
July 5th, 2015 9:55pm

Don't forget that Get-MailboxPermission has the -User parameter. This one should do it much cleaner:

Get-Mailbox -RecipientTypeDetails SharedMailbox | Get-MailboxPermission -User user@domain.com

July 6th, 2015 6:33am

Hi 

No luck with this one, i changed teh domain and user to reflect my domain and user 

Unexpected token '.' in expression or statement.
At C:\Users\kaeng\Desktop\test2.ps1:1 char:21
+ Get-Mailbox | ?{($_. <<<<  RecipientTypeDetails - eq "sharedmailbox")} |Get-MailboxPermission | ?{($_.AccessRights -e
q "FullAccess") -and ($_.User -like 'DOMAIN\User') -and ($_.IsInherited -eq $false)} | ft Id*
    + CategoryInfo          : ParserError: (.:String) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

Please note i have not pasted my Domain Name nor the Users name 

Free Windows Admin Tool Kit Click here and download it now
July 6th, 2015 11:20am

Remove the space from $_. RecipientTypeDetails

Get-Mailbox | ?{($_.RecipientTypeDetails -eq "sharedmailbox")}

Also include -ResultSize Unlimited to search mailbox more than first 1000

Get-Mailbox -resultsize Unlimited | ?{($_.RecipientTypeDetails -eq "sharedmailbox")} |Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\User') -and ($_.IsInherited -eq $false)} | ft Id*

However I would do like this to get server side filtering with shared mailboxes and get faster result

Get-Mailbox -resultsize Unlimited -RecipientTypeDetails SharedMailbox |Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\User') -and ($_.IsInherited -eq $false)} | ft Id*

July 6th, 2015 12:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics