I already sent you a code sample that works for pulling the telephoneNumber.
It doesn't use the awkward mandatory/optional madness you're trying to use though. -----Original Message----- From: Norris, Joseph [mailto:[EMAIL PROTECTED]] Posted At: Wednesday, October 02, 2002 1:02 PM Posted To: perl-win32-admin Conversation: Active directory madness - where is the phone number and the email Subject: Active directory madness - where is the phone number and the email 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 _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
