HighTechTalks DotNet Forums  

Unable to get members of Distribution List using LDAP

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss Unable to get members of Distribution List using LDAP in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?QmlsbCBLbGVpbg==?=
 
Posts: n/a

Default Unable to get members of Distribution List using LDAP - 08-14-2007 , 04:28 PM






Hello,

I'm trying to get all the email addresses of a distribution list using .NET.
This DL also has nested DLs and need all the emails of there members. All I
have been able to get is the email of the main group. Here is my code:

Dim results As SearchResultCollection
Dim drsSearcher As DirectorySearcher
Dim dreEntry As DirectoryEntry
Dim val As SearchResult

Try
dreEntry = New DirectoryEntry("LDAP://xxx.xx.xxx.xx.xx")
dreEntry.AuthenticationType = AuthenticationTypes.ReadonlyServer
drsSearcher = New DirectorySearcher(dreEntry)
drsSearcher.Filter = "" 'I have no idea what to put for the
filter at this point
drsSearcher.SearchScope = SearchScope.Subtree
results = drsSearcher.FindAll

For Each val In results
lstProperties.Items.Add(val.Properties("mail").Ite m(0))
Next
lblCount.Text = results.Count

Catch ex As Exception
MsgBox(ex.Message)
End Try

I'm not too terribly familiar with LDAP, so any help would be appreciated.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.