q mas gente del foro tengo un codigo en vb.net con asp.net donde se muetran la cuentas del active directory el problema es q solo me muetra los datos de la cuenta donde estoy iniciando el programa y la idea es q me muestra todos los usuario, para poder guardarlos en la base de datos y de esta manera crear roles para cada uno de ellos,, les agradezco mucho su ayuda
''''''''''''''''''''''''''''
Dim ResultCount As Integer
Dim RcdCount As Integer
Dim selec As String
Dim username As String
Dim pwd As String
Dim strPath As String
Dim strDomain As String
Dim domainAndUsername As String
Dim DirectoryEn As String
username = "Prueba"
pwd = "1234"
strPath = "LDAP://net.servi.com/DC=net,DC=servi,DC=com"
strDomain = "net"
domainAndUsername = strDomain + "\" + username
Dim root As New DirectoryServices.DirectoryEntry(strPath, username, pwd)
Dim rootSearch As New DirectorySearcher(root)
Dim SearchResult As SearchResult
Dim results As SearchResultCollection
Dim SearchScope As SearchScope
SearchScope = SearchScope.Subtree
Dim pam
pam = Split(Me.User.Identity.Name, "\")
rootSearch.Filter = ("(samaccountname=" & pam(1) & ")")
results = rootSearch.FindAll
For Each SearchResult In results
Lista.Text &= SearchResult.Properties("samaccountname").Item(0) & "<BR>"
Lista.Text &= SearchResult.Properties("CN").Item(0) & "<BR>"
Lista.Text &= SearchResult.Properties("mail").Item(0) & "<BR>"
Lista.Text &= SearchResult.Properties("company").Item(0)
Next