Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading windows doamin groups 2

Status
Not open for further replies.

SgtB

IS-IT--Management
Oct 3, 2002
447
US
I'm creating a script to automate some windows tasks. I was wondering if there was a module, or anthoer way for perl to read windows domain groups. Ideally I'd like to read the contents of a windows group, and create a list with all the users inside.
Is there anything like this out there?

Thanks!

I'll see your DMCA and raise you a First Amendment.
 
Thanks Stiddy, I've been lokking into that one. Looks like it'll help me out a bit.

Thanks!

I'll see your DMCA and raise you a First Amendment.
 
You may want to look at Win32::AdminMisc [1] and Win32::NetAdmin [2].

[1] [2]
Win32::AdminMisc is not available from CPAN, but via the authors site [3]. Dave also has a PPM repository [4] to which you can point your version of PPM if you want to install with that method.

[3] [4]
If you want to know how to add another repository to PPM, please read the FAQ for this forum.


Barbie
Leader of Birmingham Perl Mongers
 
use Win32::NetAdmin;
use Win32::AdminMisc;

#### Get the PDC for the domain
Win32::NetAdmin::GetDomainController("", "TESTDOM" , $PDC);

#### retrieve all of the local users
Win32::NetAdmin::GroupGetMembers($PDC, YourGroupName, \@users) or die ("Unable to get users: $!\n");

 
Stiddy and StgB it sounds like you two should do some collaberating. Both of you seem to be inventing the wheel indepentently. You should think about putting your heads together.


haunter@battlestrata.com
 
This was just for a quick script to automate the transfer of user directories, along with shares, and permissions. All user folders needed to be granted full access for that particualr user...anyway...

Thanks for al lthe help! Hopefully I won't be doing that anytime soon, but those win32 modules will help out in the future. Thanks Barbie for the advice on the second module, and the great links! Thanks Stiddy, for spelling it out for me. I'm pretty new to perl so this kind of help was exactly what I was looking for.
Thanks for making Tek-Tips.com one of the greatest technical sites out there!
[thumbsup2]

I'll see your DMCA and raise you a First Amendment.
 
Your welcome, actually haunter is currently helping me out on a similar script so I can't take all the credit...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top