Skip to main content
October 24, 2008
Question

Accessing Windows User Information

  • October 24, 2008
  • 2 replies
  • 470 views
I have a site set up that has a customised section that is different depending on what computer they are accessing the site from.

I currently achieve this by using a switch statement on the computer's IP address. However, in the near future we are having a windows domain set up and this code will not work as all IP addresses show as the same when on the domain.

Is it possible to automatically obtain the user information of the logged in (to windows) user? If so, how is that done?!

All I would need is their username (as their username will always be unique.)
    This topic has been closed for replies.

    2 replies

    tclaremont
    Inspiring
    October 24, 2008
    Sorry, I have not used Apache in years, so I can't answer that question.

    Try this on a new CFM page and see what it returns:

    <cfdump var="#CGI#">

    tclaremont
    Inspiring
    October 24, 2008
    If you are using Internet Information Services, and authentication is turned on in IIS, you can use the following variable to return the domain/username:

    #cgi.auth_user#

    This has been discussed quite a bit, so do a search on these forums and the full methodology will be found.
    October 24, 2008
    I'm using Apache web server and #cgi.auth_user# is therefore null. Is there a similar variable for Apache?