Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Getting windows account name

by pKai (Priest)
on Apr 18, 2007 at 13:14 UTC ( #610764=note: print w/replies, xml ) Need Help??


in reply to Getting windows account name

Assuming you are on an ActiveState Perl:
use strict; use warnings; #use Win32; print 'I am ', Win32::LoginName, ' in domain ', Win32::DomainName, $/;

In addition to the informative thread marto referred to above, which points to Win32::LoginName, knowing the domain an accounts comes from might be of interest too, especially in a bigger AD environment (forest).

Also note, that ActiveState's perl on Windows is special, with regard to the Win32 module, insofar as it distinguishes between "[CORE]" functions and others.

Those [CORE] functions are available, even without a "use Win32;" (LoginName and DomainName among them).

More information on Win32 functions is available from the cmd command line with perldoc Win32.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2021-04-14 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?