DirectoryServices and Windows Integrated Auth.

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
 
M

M. Zeeshan Mustafa

Mohammad,

Are you impersonating user identity? Your ASP.NET application
on live server is running in a security context of a user which
does not have permissions to query.

You have to run your ASP.NET application under a user which has
permissions to query, otherwise you have to explicitly specifiy login/pass.

http://msdn.microsoft.com/library/en-us/vsent7/html/vxconaspnetdelegation.asp
http://codeproject.com/Purgatory/Identity.asp
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconConfiguringASPNETProcessIdentity.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top