473,497 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectoryServices and Windows Integrated Auth.

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
Nov 18 '05 #1
1 1948
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...delegation.asp
http://codeproject.com/Purgatory/Identity.asp
http://msdn.microsoft.com/library/en...ssIdentity.asp

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mohamed Zaki" <m_*********@link.net> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1987
by: Jeremy | last post by:
In my ASP.NET web applications I would like to use "integrated security=SSPI" instead of supplying a SQL Server account credentials. From what I understand there are security policy settings...
2
1549
by: wschlichtman | last post by:
In my Windows application, I am attempting to access an SQL database called PhotoAlbum.mdf. I keep receiving the following error: Cannot open database "PhotoAlbum" requested by the login. The...
0
223
by: Avinash | last post by:
This is not so much an Asp.Net Question. Any help/suggestions will be apprecaited. I am currently working on an application suite consisting of both desktop apps and web apps developed with the...
2
2609
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
0
963
by: Johhny 0 | last post by:
Hi, I'm having an issue with permissions using the System.DirectoryServices namespace at a customer site. It's an ASP.net app that is using windows integrated security. One of the functions that...
8
16465
by: Keith H | last post by:
I'm looking for a way to force the user to re-authenticate with their Windows username/password/domain after clicking the submit button on an ASP.NET page. This is for an internal application. ...
9
2128
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
8
16642
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows...
18
273
by: Rotsey | last post by:
Hi, I have a windows service that does some distributed transcation across 2 servers. One DB is SQL 2005 express and the other is SQL 2005. My question is I have created a domain user account...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7162
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.