Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to get system user name from windows using perl

by Sinistral (Prior)
on Nov 10, 2011 at 14:01 UTC ( #937379=note: print w/ replies, xml ) Need Help??


in reply to Re: How to get system user name from windows using perl
in thread How to get system user name from windows using perl

Au contraire, Windows absolutely does maintain the current user information. Although there isn't a native command to get it, a a quick Googling came across these options:

For a native Perl solution, there is: http://stackoverflow.com/questions/3526420/how-do-i-get-the-current-user-in-perl-in-a-portable-way/3531096#3531096. To keep information at PerlMonks, the answer cited refers to using Win32 which has a LoginName function (which doesn't return domain, if you're using Active Directory) or Win32::pwent.


Comment on Re^2: How to get system user name from windows using perl
Re^3: How to get system user name from windows using perl
by Anonymous Monk on Nov 10, 2011 at 16:08 UTC

    Au contraire, Windows absolutely does maintain the current user information.

    Where is the department name? Acronym, e.t.c?

    Reading comprehension is fun :)

      That information is available via Exchange, Active Directory, or other corporate directory structure. A standalone Windows workstation doesn't maintain such details. They can be retrieved easily, but unless the OP says what infrastructure exists in their organization we can't help

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937379]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-09-20 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls