Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2006, 12:56 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to take User's Full Name from Active Directory

hi friends,

     I am having one problem regarding accessing ActiveDirectory. My requirement is need to display the user name which is available in Activedirectory in the top of the webpage which a application(TimeTracker) we are using in intranet. I search the net and found some codings, they provide for console application and I created a console application and applied the codings, it is working fine all the way. I used the same coding in webapplication but it is not working. Can u able to tell me , why the problem is and can u able to help me to get out of this.

Note: i am using windows authentication.

The following is the code I used in the Page_Load event



DirectoryEntry entry = new DirectoryEntry("LDAP://ECWEB.local");

DirectorySearcher dSearch = new DirectorySearcher(entry);

String Name="krishnaprabhu";// name

dSearch.Filter = "(&(objectClass=user)(givenName=" + Name + "))";





foreach(SearchResult sResultSet in dSearch.FindAll())

{



// Login Name

Response.Write(GetProperty(sResultSet,"cn"));

// First Name

Response.Write(GetProperty(sResultSet,"givenName") );

// Middle Initials

Response.Write(GetProperty(sResultSet,"initials")) ;

// Last Name

Response.Write(GetProperty(sResultSet,"sn"));

// Address

string tempAddress=GetProperty(sResultSet,"homePostalAddr ess");

}








Similar Threads
Thread Thread Starter Forum Replies Last Post
how to take User's Full Name from Active Directory krisshnaprabhu General .NET 0 May 31st, 2006 12:59 AM
Finding user's home directory path bluckcuck Excel VBA 3 July 18th, 2005 09:23 AM
About Active Directory apalmero VB How-To 1 April 8th, 2005 04:06 PM
About Active Directory apalmero VS.NET 2002/2003 1 November 9th, 2003 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.