Not tested with the 23 March 2007 update, but should work anyway.
sub AD_enumerate_O ($$) { my $dn = shift; my $type = shift; $dn =~ s|^(LDAP://)?|LDAP://|; disable_ole_warnings; my $ou_hand = Win32::OLE->GetObject("$dn"); # this does not seem to work # $ou_hand->{Filter} = [ $type ]; enable_ole_warnings; if (not $ou_hand) { carp "WARNING: ".Win32::OLE::LastError."\n"; return undef; } my @list; foreach my $hand ( in $ou_hand ){ # other interesting properties are: # http://msdn.microsoft.com/library/en-us/netdir/adsi/iads.asp # also works for the 'other' properties of the entry next unless $hand->{Class} eq $type; #simpler than filter push @list, $hand; }; return [ @list ]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Active Directory Object Handles
by jdporter (Paladin) on May 31, 2007 at 14:19 UTC | |
by girarde (Hermit) on May 31, 2007 at 16:08 UTC |