Link to home
Start Free TrialLog in
Avatar of swfixit
swfixitFlag for United States of America

asked on

How to find out all exchange distribution lists user is manager of

I need a way to find out which distribution lists an active directory account is a manager of.
Avatar of karim_hashish
karim_hashish

if i understood your question right that you want to get the manager of each distribution group use the following code

For further help don't hesitate to refer back

Regards,
Karim
Get-DistributionGroup  | select name, managedby

Open in new window

Avatar of swfixit

ASKER

Actually I need to get all the distribution groups managed by named account.  So if I could do some sort of customized query for userA tha would return all DL's managed by userA
Is this Windows Server 2008 or 2003 + SP2. If yes You can use LDAP query using LDAP_MATCHING_RULE_IN_CHAIN control, description here: http://support.microsoft.com/?kbid=914828

Example #4 describes your situation:
(...)
Example 4: Verify the reporting hierarchy under a user
To verify the users who report to User1, you can use the following parameters in the query:
Base: users container or any container above it (cn=users, dc=domain)
Scope: subtree
Note A query to a one-level depth also works if all the users are in one flat container.
Query: (manager:OID:=User1DN)
Returns: The distinguished name of all the users who effectively report to User1.
(...)

But You need to query DLs instead of users and managedBy attribute
--
Tomasz Onyszko
ASKER CERTIFIED SOLUTION
Avatar of karim_hashish
karim_hashish

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way if you want to get the distinguished name of the user account using powershell to use it in the above post use the below command.

Get-User -Identity sam1 | select distinguishedname

Open in new window