This post is a result of me going off on a tangent. Howard replied to a post in which he provided a link to his Perl utilities page. He has a spiffy little utility to query Exchange mailboxes and it made me wonder if I could do it with ADSI. When I searched this BB for ADSI and Exchange, I didn't find much so I did my own research. Here's what I came up with:

code:
break on cls
$=execute(ListMailboxInfoByUser("$user"))

function ListMailboxInfoByUser($user)
$mailbox=getobject("LDAP://oh01ex01/cn=$user,cn=Recipients,ou=World HQ,o=Relizon")
? "Mailbox Information for $user:" ?
? "User Information:"
? " Display Name: " $mailbox.get("cn")
? " Given Name: " $mailbox.get("givenname")
? " Last Name: " $mailbox.get("sn")
? " Alias: " $mailbox.get("uid")
? "Mailbox Information:"
? " Primary SMTP: " $mailbox.get("mail")
? " X.400 Address: " $mailbox.get("textencodedoraddress")
? " Home MTA: " $mailbox.get("home-mta")
? " Home MDA: " $mailbox.get("home-mda")

? "Other Mailboxes:"
$array=$mailbox.get("othermailbox")
for each $item in $array
$oname=substr($item,1,instr($item,"$$")-1)
$oaddress=substr($item,len($oname)+2,len($item))
? " " $oname ": "$oaddress
next
endfunction

The output is as follows:

code:
Mailbox Information for ShiltCK:

User Information:
Display Name: Shilt, Christopher K
Given Name: Christopher
Last Name: Shilt
Alias: Christopher.Shilt
Mailbox Information:
Primary SMTP: Christopher.Shilt@Relizon.com
X.400 Address: c=US;a= ;p=Relizon;o=WorldHQ;s=Shilt;g=Christopher;i=K;
Home MTA: cn=Microsoft MTA,cn=OH01EX03,cn=Servers,cn=Configuration,ou=World HQ,o=Relizon
Home MDA:
Other Mailboxes:
X500: /o=Relizon/ou=World HQ/cn=Recipients/cn=ShiltCK
NOTES: Christopher K Shilt/World HQ/Relizon@Relizon
MS: RELIZON/WORLDHQ/CHRISTOPH3
CCMAIL: Shilt, Christopher at World HQ

I love to have some feedback/improvement on this. If you try it out, you'll naturally have to provide your own Exchange server, OU, O, etc. This was tested on Exchange 5.5. It should work on Exhcange 5.5 and earlier. M$ says it won't work on Exchange 6. Management and access to Exchange 6 should use the CDOEXM interfaces instead.