Can I Get group members from active directory using an LDAP query (ASP)

Can I Get group members from active directory using an LDAP query (ASP)

Post by Khal » Sat, 16 Mar 2002 06:18:35



I was able to get all the groups under a certain domain by using the
following query from an asp page

"Select cn FROM 'LDAP://domain.com' WHERE objectClass='group' order by
cn "

Now I want to get the members of the group using a similar query

Is that possible, please help.
Thanks

 
 
 

Can I Get group members from active directory using an LDAP query (ASP)

Post by Joe Richards [MVP » Sat, 16 Mar 2002 10:17:21


Just bind to the group and enumerate the members attribute, you don't have
to do a search.

--
Joe Richards
www.joeware.net
---


Quote:> I was able to get all the groups under a certain domain by using the
> following query from an asp page

> "Select cn FROM 'LDAP://domain.com' WHERE objectClass='group' order by
> cn "

> Now I want to get the members of the group using a similar query

> Is that possible, please help.
> Thanks


 
 
 

1. Problem in getting Domain Name from the Active Directory using LDAP Query

Hi All,
    I wanted to get the domain name from Active Directory
When i login to my windows i get to see my domain as "lotus"

but iam not able to get the domain name through LDAP query
I use the following query

strADOQuery = "select samaccountname,distinguishedName,cn from " & _
                "'LDAP://DC=direct,DC=com' " & _
                "where objectCategory='Person' AND objectClass='user' and
( givenname = '*anil*' or sn = '*anil*' or samaccountname = '*anil*' ) "

oCmd.CommandText = strADOQuery
Set oRecordSet = oCmd.Execute

when i loop through the recordset i get the following result

cn :  Anil Kumar
distinguishedName :  CN=Anil Kumar,CN=Users,DC=direct,DC=com
samaccountname :  anil

I would also like to get the domain name "lotus" in the results

Note: When i click on the properties of user in active directory, under the
Account tab i get to see in
User logon name (Pre-windows2000) the domain name as "lotus\"

Please tell me how to get this, am i missing any attribute which is required
to get the result or whether there is some problem with my query.

Thanks
        Anil Kumar

2. soapsuds.exe generated code and "Invalid Return Type" Exception

3. Getting User Information from Active Directory via ASP/LDAP Provider

4. Procmail manual?

5. LDAP/Active Directory code example of:Getting/Setting domain password, Getting email groups, and Getting email group members

6. Ideas for a scrambling system...

7. Add user to group in Active Directory by using asp pages

8. create group in active directory by using asp on the web

9. Getting Nested Group Names of a member in LDAP

10. Retrieving all the members of an Active Directory security group (including NESTED)

11. LDAP/ADO execute query gets 80004005 from ASP, works from VB and VBS