http://www.perlmonks.org?node_id=1017533


in reply to Re^3: Obtaining Windows username from an intranet ActiveState Perl script
in thread Obtaining Windows username from an intranet ActiveState Perl script

Because the users are on intranet and it's a Microsoft IT environment, their browser automatically identifies who they are (I believe using NTLM authentication).

Using ASP, the variable is HttpContext.Current.User

The original post that I linked to also describes this scenario (where the intranet user never has to supply their username/password to the site, but the site can still obtain it).

Replies are listed 'Best First'.
Re^5: Obtaining Windows username from an intranet ActiveState Perl script
by Anonymous Monk on Feb 07, 2013 at 08:24 UTC
    So, you're running this "perl script" under what environment? Have you looked inside %ENV?
      I am running this script using Apache Web Server on Windows. I have tried the code that displays all variables inside of %ENV, but in terms of identifying the users that shows only their IP and not their username.

        but in terms of identifying the users that shows only their IP and not their username.

        Did you setup NTLM authentication on apache? For the URI where your program runs? What interface (mod_perl/cgi)?