It works for me.  I've added a bit of error checking - let me know what 
the error is:


#!perl
use strict;
use warnings;
use Win32::OLE qw(in);

my $hostname = $ENV{COMPUTERNAME};
my $username = 'Administrator';

my $user = Win32::OLE->GetObject("WinNT://$hostname/$username,User")
   or die Win32::OLE->LastError;

foreach my $group (in $user->Groups) {
  printf  "%s\n",$group->Name;
}


Peter Vogel wrote:

> Hi all,
> 
>  
> 
> I'm trying to get the following script to work:
> 
>  
> 
> use Win32::OLE;
> $user = Win32::OLE->GetObject("WinNT://ARSIN01/pvogel,User");
> foreach $group (in $user->Groups) {
>  printf  "%s\n",$group->Name;
> }
> 
>  
> 
> But $user keeps coming back as an empty hash after
> 
> the call to GetObject...
> 
>  
> 
> Am I missing something?  What does it take to get to ADSI from
> 
> Perl in Win2K?
> 
>  
> 
> Thanks,
> 
> -Peter
> 
> --
> Peter A. Vogel
> Manager, Configuration Management
> Arsin Corporation
> 4800 Great America Parkway Suite 425, Santa Clara, CA 95054
> 
>  

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to