Active Directory Users List - Reg
-
Hi , I need to extract the active directory userlist (Windows Login ID ). i am new to active directory users list. I have used the System.Directories dll to extract the information. Below ismy code snippet. The code is written in VB.Net web application.
Dim searchRoot As New DirectoryEntry("LDAP://TESTLAB") Dim search As DirectorySearcher = New DirectorySearcher(searchRoot) search.Filter = "(&(objectClass=user)(objectCategory=person))" search.PropertiesToLoad.Add("sAMAccountname") Dim result As SearchResult For Each result In search.FindAll() Response.Write(result.Properties("sAMAccountName")(0)) Response.Write(" ") Next `When i execute the above code , i am not able to get the list of windows user id. Can anyone help me out for this , Thanks in advance Sasidar`