List managed users in Exchange 2010

I want to list all users "managed" by a certain user in Exchange 2010. Is this possible?
LVL 1
HaroldNetwork EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VB ITSSpecialist ConsultantCommented:
The Manager field is an AD attribute, not Exchange so no need to use the Exchange server to do this.

The below code snippet will list all users that have John Smith set as their Manager. John's account is located in the Company\Users OU in Active Directory Users and Computers. Domain name is simply company.com

Log into your DC, open PowerShell then type in the following:
Import-Module ActiveDirectory
Get-ADUser -Filter {Manager -eq "CN=John Smith,OU=Users,OU=Company,DC=company,DC=com"} | fl Name

Open in new window

0
HaroldNetwork EngineerAuthor Commented:
VB ITS: I'm confused, from the Exchange GUI is where I set the Management of a user to manage another e-mail account, why would the information not come from the Exchange server? This is Windows 2003 too, don't see PowerShell.
0
VB ITSSpecialist ConsultantCommented:
My apologies, I thought you were referring to the Manager field that can be find in the user's account properties in AD.
Manager-Field-in-AD.pngJust to clarify, do you need a list of mailboxes a particular user has Full Access to? Otherwise please post a screenshot of the area that you are speaking of, just to clear up any confusion.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

HaroldNetwork EngineerAuthor Commented:
VB ITS: "Just to clarify, do you need a list of mailboxes a particular user has Full Access to?" Correct, we've added Management to several users that have left the company, to one user and we can't remember them all. I know they should show up in Outlook, but I'd like to be able to run a report to show me a list.
0
VB ITSSpecialist ConsultantCommented:
Not a problem. Below is a command you can run in the Exchange Management Shell to achieve this. Note that you will need to replace DOMAIN\user below with your domain name and username for the user in question:
Get-Mailbox | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | ft Identity 

Open in new window

0
HaroldNetwork EngineerAuthor Commented:
VB ITS: PERFECT! can I dump these reports to a file too? Like c:\managed.txt, if so where would I put that?
0
VB ITSSpecialist ConsultantCommented:
Sure, we just add| Export-Csv -NoTypeInformation C:\Managed.csv to the end of the script and change the way it outputs the result, so the new command should look like this:
Get-Mailbox | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | Select Identity | Export-Csv -NoTypeInformation C:\Managed.csv

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HaroldNetwork EngineerAuthor Commented:
VB ITS: Excellent!  One more if I may, can the output be changed to list users Managed and by whom?

I will not ask no more.
0
VB ITSSpecialist ConsultantCommented:
How about this? I've removed the output to Csv line for now to prevent you from having to go and manually open it to check it has the correct output:
Get-Mailbox | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | Select Identity,User

Open in new window

If that looks right to you just add | Export-Csv -NoTypeInformation C:\Managed.csv to the end of it to generate the .csv output file.
0
HaroldNetwork EngineerAuthor Commented:
VB ITS: with last command, it's still a single user. I was wondering if the output could list all users managed and who they are managed by. Then I can go in and clean up the ones that are not needed.
0
VB ITSSpecialist ConsultantCommented:
Ah. Well your original question was only to list mailboxes that one user has full access to. Since I'm feeling generous...
Get-Mailbox | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false)} | Select Identity,User

Open in new window

Does that give you the output you want? :)
0
HaroldNetwork EngineerAuthor Commented:
Gave first answer and more. Thanks again!!
0
VB ITSSpecialist ConsultantCommented:
Glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.