I have been using the Q&D code hack below to look inside active directory. I
can not get to the telephone or email address for the user. I can not get
any of the MandatoryProperties either.

Any help would be appreciated.  Thanks.


the code:


use Win32;
use Win32::OLE qw( in );
use Win32::OLE::Const 'Active DS Type Library';
use Data::Dumper;

my $user_name = $ARGV[0];
my $ADspath = "WinNT://" . Win32::DomainName() . '/' . $user_name;
print $ADspath . "\n";
my $user =  Win32::OLE->GetObject( $ADspath );

$user->GetInfo;
print "full name: " . $user->{Fullname}."\n";
print "path: " . $user->{ADsPath}."\n";
print "schema: " . $user->{schema}."\n";
pritn "Phone: " . $user->{telephoneNumber} . "\n";
pritn "email: " . $user->{Email} . "\n";

my $userschema=Win32::OLE->GetObject($user->{schema});
print Win32::OLE::LastError."\n";


print "\n********** Mandatory Properties of $user: ***************\n\n";
foreach my $i (@{$userschema->{MandatoryProperties}}) {
   print "$i:\t".$userschema->Get($i)."\n";
}


print "\n********** Optional Properties of $user->{Fullname}:
*****************\n\n";

foreach my $i (@{$userschema->{OptionalProperties}}) {
   print "$i:\t".$user->Get($i)."\n";
}



_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to