Dim dsUser As DataSet = New DataSet
Dim deSearch As DirectorySearcher = New DirectorySearcher
'set the search filter
deSearch.SearchRoot = de
deSearch.Filter = "(&(objectclass=group))"
'find the first instance
Dim results As SearchResultCollection = deSearch.FindAll()
'Create a new table object within the dataset
Dim tbUser As DataTable = dsUser.Tables.Add("Users")
tbUser.Columns.Add("UserName")
tbUser.Columns.Add("DisplayName")
tbUser.Columns.Add("EMailAddress")
Dim Result As SearchResult
For Each Result In results
'Create default row
Dim rwDefaultUser As DataRow = tbUser.NewRow()
rwDefaultUser("UserName") =
Result.Properties("distinguishedname")
rwDefaultUser("DisplayName") = Result.Properties("displayname")
rwDefaultUser("EMailAddress") = Result.Properties("email")
tbUser.Rows.Add(rwDefaultUser)
Next
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)