Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > Re: How to enumerate a domain group using LDAP?


Reply
Fix Vista Errors
Thread Tools Display Modes

Re: How to enumerate a domain group using LDAP?

 
 
Joe Kaplan
Guest
Posts: n/a

 
      12-08-2009
If you are going to use that type of path syntax that uses the full DN, you
have to know the actual DN of the group. Guessing won't help. It is
generally a better idea to find the group via a search first and then once
you've found it, you find the full path from that.

You might be better served using the
System.DirectoryServices.AccountManagement namespace in .NET 3.5. You can
easily find objects by known identifiers like their names and then use the
API to enumerate the members of the group very easily. Having strongly typed
objects for things like GroupPrincipal makes this much easier than with
S.DS. You end up needing to know much less about how the directory works and
is laid out.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
"John Peterson" <> wrote in message
news:. ..
>I am trying to use LDAP to list the members of a domain local group.
> MSDN has an example:
> http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
>
> I have converted the C# example to VB.NET. When I use VB.NET 2005 and
> try to run the example I get the error "There is no such object on the
> server.". If I look at the returned object "objgroup",(while in the
> debugger) it appears to not contain any data. I have tried several
> different LDAP queries shown below and get the same results. Can someone
> tell me what I am doing wrong?
>
> Dim objgroup As DirectoryEntry = New DirectoryEntry
> ("LDAP://borg2.chem.xxx.edu/CN=grpUGSShareReadWrite,DC=chem,DC=xxx,DC=ed
> u", <username>, <password>, AuthenticationTypes.Secure)
>
> For Each dn As Object In objgroup.Properties("member")
> MsgBox("Value = " & dn)
> Next
>
> Where "grpUGSShareReadWrite" is the name of the group. The group is
> located in a nested OU ChemDepartment->ChemUsers. I have also tried the
> following LDAP string:
>
> LDAP://borg2.chem.xxx.edu/CN=grpUGSShareReadWrite,OU=ChemDepartment,OU=C
> hemUsers,DC=chem,DC=xxx,DC=edu
>
> The username and password I am using is a normal user that is a member
> of the group. I have also tried using the administrator password. The
> server is a Windows 2003 Server. I am running the LDAP code on a Windows
> XP computer.
> Thank you.
>
> John
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The local domain controller could not connect with - 2008 boe Active Directory 9 11-22-2009 01:05 AM
How to assign Domain admin credential to User from trusted domain Mikoyan Active Directory 1 11-12-2009 05:34 AM
Re: Incorrect server name Ace Fekay [MCT] Windows Server 4 10-28-2009 02:17 PM
Re: Migrate from one 2003 Domain to another 2003 Domain Meinolf Weber [MVP-DS] Server Migration 0 10-22-2009 07:35 AM
Re: Adding domain member to local admin group Eric Visser Windows Vista Administration 0 02-03-2007 04:23 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59