BadMojo has asked for the wisdom of the Perl Monks concerning the following question:

I found Win32::NetAdmin
that has a function GroupGetMembers(server,group,userArray)
this is what my code looks like any idea why this isn't working?

 

#!/usr/bin/perl -w use strict; use Win32::NetAdmin; my @userArry= (); Win32::NetAdmin->GroupGetMembers("mna.corp.mosaicco.com", "Web Proxy U +sers", @userArry); print "Members of the Web Proxy Users Group are:\n"; for(my $i=0; $i<@userArry; $i++) { print $userArry[$i]; print "\n"; } print "-------EOF-----\n";

I get the following Error:Usage:

Win32::NetAdmin::GroupGetMembers(server, groupName, \@userArray)

Can anybody help?

BadMojo
mford@badmojo.biz
www.badmojo.biz

!=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-!
When something works but shouldn't thats BADMOJO baby.

Replies are listed 'Best First'.
Re: Win32::NetAdmin ?
by aukjan (Friar) on Aug 10, 2005 at 13:30 UTC
    Well look at the error you get:

    USAGE: Win32::NetAdmin::GroupGetMembers(server, groupName, \@userArray)

    This tells you that you have to pass the array as a reference, and this is not what you are doing:

    Win32::NetAdmin->GroupGetMembers("mna.corp.mosaicco.com", "Web Proxy Users", @userArry);

    This should be fixed by changing the line to this:

    Win32::NetAdmin->GroupGetMembers("mna.corp.mosaicco.com", "Web Proxy Users", \@userArry);

    Go Fish!