Exchange 5.5 servers are also LDAP servers, so you should be able to use any of the
available LDAP modules. I've used Net::LDAP with success. The biggest "gotcha" is
that the attribute names Exchange 5.5 uses are not as "standard" as they should be.
But this works:
#!/usr/local/bin/perl5
use strict;
use Net::LDAP;
my $uid = $ARGV[0];
# Replace 'exchangeserver' w/your own server name
my $ldap = new Net::LDAP("exchangeserver");
# Anonymous
$ldap->bind();
my $attribute = ['mail'];
my $msg = $ldap->search(
scope => "sub",
# modify the filter as needed. This works for us. It's usually better to
# also filter on the objectClass.
filter => "(|(uid=$uid)(rdn=$uid))",
attrs => $attribute
);
$msg->code && die $msg->error;
my ($entry);
foreach $entry ($msg->entries) {
print @{$entry->get('mail')}[0], "\n";
}
$ldap->unbind; # take down session cleanly
Of course, there's more than one way to do it... ;) This works for us (from an HP/UX
box querying our Exchange server). Should work on Win32 as well.
Rick
---
Rick Tatem
Messaging and Directory Resources
SAS Institute
SAS... The Power To Know
-----Original Message-----
From: Vinod Panikar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 12:12 PM
To: [EMAIL PROTECTED]
Subject: domain\NT account and Exchange Server
Hi there,
Is there anyone who can tell me how to get SMTP address from an Microsoft Exchnage
Server 5.5 if we provide NT domain\username?
Thanks in Advance.
Vinod
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://adfarm.mediaplex.com/ad/ck/990-1736-3566-59
_______________________________________________
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