Welcome Guest Search | Active Topics | Members | Log In | Register

dotnet forum » C#, VB.NET, C++ » C# » Eliminate inactive DL's from LDAP directory seach

Eliminate inactive DL's from LDAP directory seach Options
Anuradha
Posted: Friday, January 29, 2010 4:16:27 AM
Rank: Newbie
Groups: Member

Joined: 1/13/2010
Posts: 0
Points: 6
Location: chennai
hi ,
iam using LDAP to get the DL(distribution lists)names from my domain.but iam getting Inactive DL names also...how to filter inactive DL's from my domain.
is there any filter like that.
please see the below code what iam using....
please help me in this regard.Thanks in advance.


Dim search As DirectorySearcher
Dim entry As DirectoryEntry
Dim count As Integer = 0
Dim txtDlName As String
Dim lstrreutrn As Boolean = False
txtDlName = Request.QueryString("DLnameForLDAP")
Dim lstrDLname As String = txtDlName.Trim()

Dim ldstDL As DataSet = New DataSet()
Dim ldt As DataTable = ldstDL.Tables.Add()
ldt.Columns.Add("DLname", GetType(String))
entry = New DirectoryEntry("LDAP://DC=domain,DC=com") ', Domainwithuser, password);
search = New DirectorySearcher(entry)
search.Filter = "CN=" & lstrDLname & "*"
Dim i As Integer = search.Filter.Length

For Each AdObj As SearchResult In search.FindAll()
If (AdObj.GetDirectoryEntry().SchemaEntry.Name = "group") Then
Dim dr As DataRow = ldt.NewRow()
dr("DLname") = AdObj.GetDirectoryEntry().Name.Substring(3)
If dr("DLname").ToString().Length > 1 Then
ldt.Rows.Add(dr)
End If
count += 1
End If
Next
ldstDL.Tables(0).TableName = "DLDetails"
Return ldstDL.GetXml()
Users browsing this topic
Guest

dotnet forum » C#, VB.NET, C++ » C# » Eliminate inactive DL's from LDAP directory seach


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.6 (NET v2.0) - 11/14/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.036 seconds.