Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Display Logged on User's Name
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Display Logged on User's Name

 Post Reply Post Reply
Author
 Rating: Topic Rating: 1 Votes, Average 4.00  Topic Search Topic Search  Topic Options Topic Options
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Topic: Display Logged on User's Name
    Posted: 16 March 2010 at 4:35pm
I have a page where I need to display the user's full name. The users are authenticated by Windows when accessing the site.

I have accomplished this, but I'm sure there must be an easier way. Is it possible to display the user's "Display Name" as it is entered in Active Directory?

My quick solution, after not being able to find a better way on Google, was to create a new table in the database and call it "users". I made two columns. 1 called "LogonName" where I entered the domain logons for all of the users who need to access the site right now. The other column is called "DisplayName" in this column I entered the users' full names.

I threw in this SQL statement:
strSQL = "SELECT *  FROM users WHERE LogonName = '"&request.serverVariables("LOGON_USER")&"';"


And where I needed to display the name I placed this code:
<%Response.Write (rsUser("DisplayName"))%>


This works for now, but in the future more users will need to access the site, so is there a way that I can simply pull the Display Name from Active Directory?

Thanks in advance!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.