Solved

List shared mailboxes and users with access to them

Posted on 2014-04-14
3
779 Views
Last Modified: 2014-05-09
Experts,

I need help with a script to list all shared mailboxes in Exchange 2010 SP2 organizations along with a list of users having access to that mailbox.
For example user1 delegated his mailbox to user3, user7, so the report will produce similar output "User1: User3, User7"

The format can be anything readable, does not have to be on a single line. I have searched for such scripts on EE< nothing worked for me. I need to run it on about 200 users most of them have shared their mailboxes with others.

Appreciate your help.
0
Comment
Question by:Coffinated
3 Comments
 
LVL 3

Assisted Solution

by:petekdoku
petekdoku earned 250 total points
ID: 39999495
Hi,

get-mailbox  | where-object {$_.recipienttypedetails -like "*shared*"} | get-mailboxpermi
ssion | where-object {$_.accessrights -like "*full*" } | ft identity, user

identity: the shared mailbox name.
user: full access to that shared mailbox.
0
 
LVL 5

Author Comment

by:Coffinated
ID: 39999852
petekdolu

It does not print any results

[PS] C:\Users\Administrator\desktop>Get-Mailbox | Where-Object {$_.RecipientTypeDetails -like "*shared*"} | Get-MailboxPermission | Where-Object {$_.AccessRights -like "*full"} | ft identity,user
WARNING: By default, only the first 1000 items are returned. Use the ResultSize parameter to specify the number of items returned. To return all items, specify "-ResultSize Unlimited". Be aware that, depending on the actual number of items, returning all items can take a long time and consume a large amount of memory. Also, we don't recommend storing the results in a variable. Instead, pipe the results to another task or script to perform batch changes.
[PS] C:\Users\Administrator\desktop>
0
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 250 total points
ID: 39999953
add

-Resultsize Unlimited

after

Get-Mailbox

and before

| where-object

since by default limit is 1000 and you have more than 1000 mailboxes.

and in fact I think it is better to filter it before hand.
$Mailboxes = Get-Mailbox -Resultsize Unlimited -Filter {RecipientTypeDetails -eq "SharedMailbox"} 
foreach ($mailbox in $mailboxes)
{
Get-MailboxPermission $Mailbox.Name | ? {$_.AccessRights -like "*FullAccess*"} | Select-Object @{N="Mailbox Name";E={$Mailbox.Name}},User
}

Open in new window


 {RecipientTypeDetails -eq "SharedMailbox"}  = The Mailbox Attribute is SharedMailbox, if you have no sharedmailbox under your exchange, you will have no return.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read this checklist to learn more about the 15 things you should never include in an email signature.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question