get the mailbox information about the users that having access to Shared mailbox using powershell
Hi, I have more then 1000 shared mailbox that I need to pull out all the email addresses of all users having access to these shared mailboxs (users having full permissions) I'm using this script to pipeline the information on one account then to try it on a list using an excel sheet. get-mailbox -identity "email@domain" | foreach {get-mailboxPermission $_.Identity |Where {$_.AccessRights -like '*FullAccess*'}} | foreach {get-mailbox -identity $_.user | select primarysmtpaddress} When using this script it is giving me and error for each user haivng Full permissions saying: Get-Mailbox : Cannot bind parameter 'Identity'. Cannot convert "CORP\Enterprise Admins" to "Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter". Any idea how to fix the issue or to obtain the information. Thanks
August 6th, 2010 8:39pm

You probably want to filter out the inherited and Deny permissions. get-mailbox -identity "email@domain" | foreach {get-mailboxPermission $_.Identity |Where {$_.AccessRights -like '*FullAccess*' -and $_.isinherited -eq $false -and $_.Deny -eq $false}} | foreach {get-mailbox -identity $_.user | select primarysmtpaddress} [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2010 8:49pm

thanks for the quick reply, I have tried it but still getting the error below: Get-Mailbox : Cannot bind parameter 'Identity'. Cannot convert "Domain\username1" to "Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter". At line:1 char:222 + get-mailbox -identity "email@domain" | foreach {get-mailboxPermission $_. Identity |Where {$_.AccessRights -like '*FullAccess*' -and $_.isinherited -eq $ false -and $_.Deny -eq $false}} | foreach {get-mailbox -identity <<<< $_.user | select primarysmtpaddress}
August 6th, 2010 8:52pm

Any better? get-mailbox -identity "email@domain" | foreach {get-mailboxPermission $_.Identity |Where {$_.AccessRights -like '*FullAccess*' -and $_.isinherited -eq $false -and $_.Deny -eq $false}} | foreach {get-mailbox -identity $_.user.tostring() | select primarysmtpaddress}[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2010 9:27pm

That is perfect, thank you so much
August 6th, 2010 9:42pm

One last thing, That will display me the email addresses, is there a way to add shared mailbox name so I can know each user have access to the specific mailbox? thanks agian
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2010 9:56pm

You can, but not as a "one-liner". You have to persist the original maibox information so you can use it later. Not tested, but I think this should work. $mbx = get-mailbox -identity email@domain get-mailboxPermission $mbx.Identity |Where {$_.AccessRights -like '*FullAccess*' -and $_.isinherited -eq $false -and $_.Deny -eq $false}} | foreach {get-mailbox -identity $_.user.tostring() | select primarysmtpaddress,@{label="AccessTo",expression=$($mbx.displaname)}}[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
August 6th, 2010 10:06pm

Thanks so much for your quick answers, I'll test it and got the idea
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2010 10:08pm

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

Other recent topics Other recent topics