From: Harikrishnan B. <har...@jp...> - 2002-03-27 23:29:06
|
Hi, I am unable to fetch the value of assoc-nt-account via Net::LDAP. I get an empty value instead. However I am able to create exchange accounts, set assoc-nt-accounts and so on. Exchange 5.5 is running on a Win 2K Server authenticating against an NT 4.0 domain controller. Would that make a difference? I have followed the code sample in http://perl-ldap.sourceforge.net/faqomatic/cache/65.html I did follow the thread http://aspn.activestate.com/ASPN/Mail/Message/perl-NTAdmins/753857 and I am familiar with the hex<->sid<->account conversions. I am just trying to somehow extract the value of assoc-nt-account. I have tried using ADSI via Win32::OLE and I have got the same result - I can fetch everything except for the nt account info. From the same code I have derived the following code to iterate all mailboxes and thier NT user-ids. I am able to fetch all other values (cn, sn, etc..) of the mailbox. ------------------------------- $exch = new Net::LDAP('DEVEXCH', debug =>0) || die $@; $exch->bind( 'cn=admin_account,cn=DEVDOMAIN,cn=admin', version =>3, password=>'somepassword'); my $result = $exch->search(base => "o=\"My Org\"", filter =>"(objectclass=organizationalperson)"); my $max = $result->count; for( my $index = 0 ; $index < $max ; $index++) { my $entry = $result->entry($index); print $entry->dn(), "\n"; # foreach my $attr ($entry->attributes, 'assoc-nt-account', 'nt-security-descriptor') { foreach my $attr ('assoc-nt-account', 'nt-security-descriptor') { foreach my $value ($entry->get_value($attr)) { print $attr, ": ", $value, "\n"; } } ------------------------------- Any help is appreciated -- Hari Bhaskaran |