The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::pwent - pwent and grent support for Win32

SYNOPSIS

    use Win32;
    use Win32::pwent qw(getpwnam getpwent endpwent);

    my $uid = getpwnam(getlogin);
    my $win32login = Win32::LoginName();
    while( my @pwent = getpwent )
    {
        if( $pwent[0] eq $win32login and $pwent[2] == $uid )
        {
            print( "It's me \\o/\n" );
            endpwent();
            last;
        }
    }

DESCRIPTION

Win32::pwent should help building a bridge for Perl scripts running on Unix like systems to Win32.

It supports reading access to LanManager User-Info structures via the well known pwent and grent functions.

EXPORT

Win32::pwent doesn't export anything by default. Following function can be imported explicitely: endgrent, getpwent, getpwnam, getpwuid, entgrent, getgrent, getgrnam, getgrgid

SUBROUTINES/METHODS

All exported subroutines behaves as the same ones for Unix-like systems provided by Perl itself. See http://perldoc.perl.org/.

getpwent

Returns the next entry from user list got from LANMAN user database. If this is the first call to getpwent (or the first call after an endpwent call), a user cache based on the LANMAN database using the functions GetUsers and UserGetInfo from the module Win32API::Net is created.

see http://perldoc.perl.org/functions/getpwent.html

endpwent

Free the user list cache and rewind the pointer for the next user entry.

see http://perldoc.perl.org/functions/endpwent.html

setpwent

Rewind the pointer for the next user entry.

see http://perldoc.perl.org/functions/setpwent.html

getpwnam

Fetches the user (by name) entry from LANMAN user database and return it

see http://perldoc.perl.org/functions/getpwnam.html

getpwuid

fetches the user (by user id) entry from LANMAN user database and return it

see http://perldoc.perl.org/functions/getpwuid.html

getgrent

Return the next group entry from LANMAN group database. If this is the first call to getgrent (or the first call after an endgrent call), a group cache based on the LANMAN database using the functions GroupEnum and GroupGetInfo from the module Win32API::Net is created.

see http://perldoc.perl.org/functions/getgrent.html

endgrent

Free the group list cache and rewind the pointer for the next group entry.

see http://perldoc.perl.org/functions/getgrent.html

setgrent

Rewind the pointer for the next group entry.

see http://perldoc.perl.org/functions/getgrent.html

getgrnam

Fetches the group (by name) entry from LANMAN user database and return it. This function doesn't uses the groups cache from getgrent.

see http://perldoc.perl.org/functions/getgrnam.html

getgrgid

Fetches the group (by group id) entry from LANMAN user database and return it. This function doesn't uses the groups cache from getgrent.

see http://perldoc.perl.org/functions/getgruid.html

AUTHOR

Jens Rehsack, <rehsack at cpan.org>

BUGS AND LIMITATIONS

Win32::pwent uses the LAN manager interface, so it might be possible that users and groups from Active Directory are not recognized.

All functions provided by Win32::pwent are pure perl functions, so they don't provide the additional features the core functions provide, because the core implementation handles them as operators.

If you think you've found a bug then please also read "How to Report Bugs Effectively" by Simon Tatham: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html.

Please report any bugs or feature requests to bug-win32-pwent at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32-pwent. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Win32::pwent

You can also look for information at:

Please recognize that the development of Open Source is done in free time of volunteers.

ACKNOWLEDGEMENTS

Jan Dubios from ActiveState who helped me through the required patches for Win32API::Net and give a lot feedback regarding compatibility.

LICENSE AND COPYRIGHT

Copyright (c) 2010 Jens Rehsack.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.