Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Getting windows account name

by pKai (Priest)
on Apr 18, 2007 at 13:14 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://610764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found