Trying setup my first perl script to automate some ADS tasks and hitting a
wall at on step 1 :) What I am trying to do is list ALL properties of an
ADS object.
Tried to use the following snippet of code right out of Perl for System
Administrators:
#########################
use warnings;
use strict;
use Win32::OLE;
$ADsPath='WinNT://SOME_DOMAIN/SOME_USER';
$adsobj = Win32::OLE->GetObject($ADsPath);
$schmobj = Win32::OLE->GetObject($adsobj->{Schema});
print join("\n",@{$schmobj->{MandatoryProperties}},
@{$schmobj->{OptionalProperties}}),"\n";
########################3
Now the OptionalProperties part works (is printed directly after the below
error) ... but MandatoryProperties errors with:
Win32::OLE(0.1502) error 0x8002000b: "Invalid index" at E:\working\ads.pl
line 9
Use of uninitialized value in array dereference at E:\working\ads.pl line 9.
Have also tried using (from
http://public.activestate.com/authors/tobyeverett/tutorial.html)
########################
use warnings;
use strict;
use Win32::OLE;
$ADsPath='WinNT://SOME_DOMAIN/SOME_USER';
$obj = Win32::OLE->GetObject($ADsPath);
my $schema = Win32::OLE->GetObject($obj->{schema});
foreach my $i (@{$schema->{MandatoryProperties}},
@{$schema->{OptionalProperties}}) {
print "$i:\t".$obj->Get($i)."\n";
}
#############
but getting the exact same error. Any ideas what copying did wrong?
Cheers and thanks in advance,
-Peter
##################################
Peter Thoenen - Systems Programmer
Commercial Communications
Camp Bondsteel, Kosovo
##################################
"Stumbled Upon"...heh (Score:5, Funny) /.
by $carab on 23:00 23 August 2002 (#4131637)
"ForensicTec officials said they stumbled upon the military networks about
two months ago, while checking on network security for a private-sector
client."
Someone new to a Dvorak probably tried to type in "lynx
http://www.google.com" but instead got "nmap -v -p 1-1024 -sS -P0 army.mil
-T paranoid".
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs