Dim dsUser As DataSet = New DataSet
Dim deSearch As DirectorySearch er = New DirectorySearch er
'set the search filter
deSearch.Search Root = de
deSearch.Filter = "(&(objectclass =group))"
'find the first instance
Dim results As SearchResultCol lection = deSearch.FindAl l()
'Create a new table object within the dataset
Dim tbUser As DataTable = dsUser.Tables.A dd("Users")
tbUser.Columns. Add("UserName")
tbUser.Columns. Add("DisplayNam e")
tbUser.Columns. Add("EMailAddre ss")
Dim Result As SearchResult
For Each Result In results
'Create default row
Dim rwDefaultUser As DataRow = tbUser.NewRow()
rwDefaultUser(" UserName") = Result.Properti es("distinguish edname")
rwDefaultUser(" DisplayName") = Result.Properti es("displayname ")
rwDefaultUser(" EMailAddress") = Result.Properti es("email")
tbUser.Rows.Add (rwDefaultUser)
Next
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"Paul D. Fox" wrote:
I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my web
service?