The module I use most for NT Administration is Win32::Lanman - It offers pretty much everything I need. I've also used Win32::NetAdmin and Win32::AdminMisc, but those are less full-featured.

One of the best features of Win32::Lanman is that all the function names & arguments are straight out of the Win32 API, so if you're already familiar with that, it's much easier to use. Plus, you can search through Microsoft's MSDN for more information on these calls if you need more info than what is provided in the documentation.

Here's the Win32::Lanman group-related functions:

Win32::Lanman::NetUserGetGroups
Win32::Lanman::NetUserGetLocalGroups
Win32::Lanman::NetUserSetGroups
Win32::Lanman::NetGroupAdd
Win32::Lanman::NetGroupAddUser
Win32::Lanman::NetGroupDel
Win32::Lanman::NetGroupDelUser
Win32::Lanman::NetGroupEnum
Win32::Lanman::NetGroupGetInfo
Win32::Lanman::NetGroupGetUsers
Win32::Lanman::NetGroupSetInfo
Win32::Lanman::NetGroupSetUsers
Win32::Lanman::NetQueryDisplayInformation

Lots of good stuff.

You could also use the Win32::OLE module combined with ADSI. And, if you are pulling groups from Active Directory you could use Win32::OLE with ADO.. this is my favorite method for accessing large AD collections. Our domain has over 61,000 computer objects and over 200,000 user objects.


In reply to Re: using perl to collect NT groups by meetraz
in thread using perl to collect NT groups by semio

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.