Ask a Question related to ASP.NET Security, Design and Development.
-
Ken Dourado #1
Active Directory, LDAP and Forms Authentication Problem
Hi,
I've got an intranet ASP.NET application that uses Forms Authentication.
What I'd like to do is get the username (in the format name.surname) of
the visitor and then retrieve their Display Name from Active Directory
using the following method:
internal static string GetUserDisplayName(string id)
{
string html = "";
DirectoryEntry objDomain = new DirectoryEntry("LDAP://DOMAINNAME");
DirectorySearcher objSearcher = new DirectorySearcher(objDomain);
objSearcher.Filter = ("(objectClass=user)(sn=" + id ")");
foreach(SearchResult sr in objSearcher.FindAll()) // this line errors
{
DirectoryEntry de = sr.GetDirectoryEntry();
html = de.Properties["DisplayName"].Value.ToString() + "<br>";
}
return html;
}
I keep getting the following error message:
System.Runtime.InteropServices.COMException: The directory service is
unavailable
I'm a newbie at this so I don't really understand where I'm going wrong
or if I have to set anything up before carrying on.
Thanks in advance for any help.
Regards,
Ken.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Ken Dourado Guest
-
Asp.Net Forms authentication using Active Directory
Hi. I am using forms authentication in ASP.Net against Active Directory. I have followed the example provided by Microsoft. Here is my problem.... -
Role based Forms Authentication (using Active Directory)
Hi All, Can anybody here kindly forward me a sample of a Role based forms Authentication using Acitve Directory? Thanks alot. P -
Forms Authentication with Active Directory using vb.net
I have seen many examples of form authentication using c#. Can someone point me to a sample using vb.net. I would like to use WinNT://domain,... -
Forms or windows authentication with active directory?
Hi, I'm having a hard time deciding (figuring out) how to implement security in my asp.net application. Requirements: - Use active directory as... -
Username not logged in IIS when using forms authentication with Active Directory
Hi! I've succesfully implemented Forms Authentication with a Active Directory, described at...



Reply With Quote

