1

Problem

I need to write an LDAP query that given a distinguishedName for a group will return a list of all users who are owners/managers of the group

Motivation

I am writing a VBA script that will allow an excel user to input a DisplayName for a group in a cell and press a button to receive (1) a list of members and (2) a separate list of group owners.

Progress

The first part works fine. I search the directory for all users who have the group in their memberof field.

For the owners, I successfully pulled the group's managedBy field, but it only contained information for a single user. This is the same user that appears in the "Owner" field when the group is viewed in Outlook's address book. There are many more users with ownership permissions for the list.

Examples

Here are the two (slightly modified) queries I'm using now:

Query 1: Group Members (works)

<LDAP://dc=DOMAIN,dc=com>;(&(memberof=CN=GroupName));DisplayName;Subtree

Query 2: Group Owners (single user returned)

<LDAP://dc=DOMAIN,dc=com>;(&(objectCategory=group)(DisplayName="Group Name"));managedBy;Subtree

The Question

How can I modify Query 2 to return all users with management permissions for the group?

Related Questions

Community
  • 1
  • 1
SuperAce99
  • 712
  • 6
  • 13
  • 1
    Here are some link that i help when i have work with LDAP with Tsql. ++++++++++++++++++++++++++++++ 1. [using excel vba to query Active directory](http://www.mrexcel.com/forum/excel-questions/553062-using-excel-visual-basic-applications-query-active-directory.html) 2. [Microsoft](http://support.microsoft.com/kb/246335) Link1 might help you.. – Hiten004 Jan 23 '13 at 21:37
  • Thanks for the links. I hadn't come across `CopyFromRecordset` before. I'll take a look at it, but I can already access the result set by looping through it. I need a way to get all the owners into the result set. – SuperAce99 Jan 23 '13 at 22:05

0 Answers0