Apologies if this is awfully basic - I have tried reading in Dave Roth's
excellent "Win32 Perl Scripting" book and in the man page for the OLE
module, don't understand.

I have been using the old Win32:NetAdmin module but with Active
Directory there are too many things it cannot do.  If I run the
following script:

use Win32;
use Win32::OLE qw( in valof );
my $domain='com';

my $AD = Win32::OLE->GetObject("WinNT://$domain,domain");

$AD->{Filter} = ["User"];    
foreach my $user (in($AD))
        {
        print "$user->{Name}\n";
        }

I can get the user's name just fine.  I want to see what other hash keys
are in the User object.  The object is reported as this sort of thing:

Win32::OLE=HASH(0x18cf608)

But when I stick a:

for my $key (%{$user})
        {
        print "$key\n";
        }

It doesn't find anything.  When I try to use:

in $user

it says it's not a collection object.

I'm afraid the fundamental problem is that I don't know much (read:
'anything') about Win32 objects, but if someone can help, I would most
grateful!


jj

John Thayer Jensen, System Administrator
Computing Services Unit, School of Business
University of Auckland

+64 9 373-7599 ext 87543
+64 21 049-7702 (mobile) - QuickDial 60001
+64 9 373-7696 (FAX)
http://staff.business.auckland.ac.nz/~j.jensen



_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to