Re: Get Clients Windows Logon ID




Amit Saxena wrote:

On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <rob.dixon@xxxxxxx> wrote:

leolim818@xxxxxxxxx wrote:

Can you please advice me how to get the Clients' windows logon user
name in perl?

$ENV{USERNAME}

Using environment variables to find username are risky !

Is there any API available for the same?

(Please bottom post your replies to this group. Thanks.)

use Win32;

my $user = Win32::LoginName;

Rob
.



Relevant Pages

  • Re: Displaying a users group memberships
    ... The user's username is passed to the script via the command line and captured with ARGV. ... I want to determine the group memberships (much like executing `groups` from the command line) and run those through a loop for processing. ... I'm very new to Perl so maybe I'm just looking for the wrong terms or something. ... The format of the command is simple: `test.pl username`, where username is a real username on the system in question. ...
    (perl.beginners)
  • script help to update member profiles
    ... form is all stored in a MySql Database (First Name, Last Name, Username, ... my partner that did all the perl scripts was injured ... Compare entered username and password to database to confirm the user is ...
    (comp.lang.perl.misc)
  • Re: variable with empty space
    ... being passed to my perl script. ... I am having a difficult time making the script stop ... if ($username eq ' ') ... die(" "); ...
    (comp.lang.perl.misc)
  • Re: Environment veriable
    ... Perl should inherit whatever the environment shell it is called in. ... UNIX) concerning environment variables. ... It should unless the batch file commands prior to it span a new ...
    (perl.beginners)
  • Re: unsetenv in the shell
    ... i have a perl program that calls another application. ... application uses the value of certain environment variables during its ... system("unsetenv VAR1"); ... in a perl script. ...
    (comp.lang.perl.misc)