"Norris, Joseph" <[EMAIL PROTECTED]> writes:

> I have figured out how to 'Name' and FullName - just by hacking
> around - is there any way to get a complete list of what $Object is
> pointing at?

(Disclaimer: I have never used Active Directory.  So this may be
completely useless.)

This page looks promising:

  http://www.microsoft.com/technet/scriptcenter/other/

In particular, the "Enumerating All the Attributes of an Active
Directory Class" link may be what you want.

I am including the subroutine I use to enumerate the properties of a
WMI class.  Perhaps you can adapt it for AD.  I do recommend "use
warnings", "use strict", and setting the Win32::OLE Warn option to 3;
these all tend to save debugging time.

 - Pat


use warnings;
use strict;
use Win32::OLE;

# Bomb out completely if COM engine encounters any trouble.
Win32::OLE->Option ('Warn' => 3);

# Display all properties of an object.
sub dump_obj ($) {
    my ($obj) = @_;
    # Get set of properties of the class.
    my $props_set = $obj->{'Properties_'};

    # Convert set to Perl array.
    my @props = Win32::OLE::Enum->All ($props_set);
    foreach my $prop (@props) {
        my $name = $prop->{'Name'};
        printf "%32s ", $name;
        my $value;
        if ($prop->{'IsArray'}) {
            $value = '<array>';
        }
        else {
            $value = $prop->{'Value'};
            defined $value
                or $value = '<undefined>';
        }
        print "$value\n";
    }
}
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to