M
Mohamed Zaki
Dear All,
I've develop asp.net solution to enumerate the domain users, this
solution using Windows Integrated Authentication, however on the staging
server it's working fine, but when moving the the live server, it throws
errors and i've to set the "UserName" and "Password" for the directory Entry
to be able to enumerate the users !!, i don't know why this happen although
i'm using domain integrated authentication, and it was working fine on the
staging server., please find the code below
Dim root As New DirectoryEntry("LDAP://DOMAINNAME")
Dim Searcher As New DirectorySearcher(root)
Searcher.CacheResults = True
'root.username='domainname\username'
'root.passsword='pwd'
'Searcher.SearchScope = SearchScope.Subtree
Searcher.Sort.PropertyName = "DisplayName"
Searcher.Filter = "(objectCategory=Person)"
Searcher.PropertiesToLoad.Add("DisplayName")
Dim Results As SearchResultCollection = Searcher.FindAll()
Dim result As SearchResult
For Each result In Results
Response.Write(result.Properties("Displayname")(0) + "<br>")
Next
Please advise.
Regards,
Mohamed
I've develop asp.net solution to enumerate the domain users, this
solution using Windows Integrated Authentication, however on the staging
server it's working fine, but when moving the the live server, it throws
errors and i've to set the "UserName" and "Password" for the directory Entry
to be able to enumerate the users !!, i don't know why this happen although
i'm using domain integrated authentication, and it was working fine on the
staging server., please find the code below
Dim root As New DirectoryEntry("LDAP://DOMAINNAME")
Dim Searcher As New DirectorySearcher(root)
Searcher.CacheResults = True
'root.username='domainname\username'
'root.passsword='pwd'
'Searcher.SearchScope = SearchScope.Subtree
Searcher.Sort.PropertyName = "DisplayName"
Searcher.Filter = "(objectCategory=Person)"
Searcher.PropertiesToLoad.Add("DisplayName")
Dim Results As SearchResultCollection = Searcher.FindAll()
Dim result As SearchResult
For Each result In Results
Response.Write(result.Properties("Displayname")(0) + "<br>")
Next
Please advise.
Regards,
Mohamed