This VBScript should work on any LDAP server, although the LdapURL is made
for Exchange 5.5 in this example.
dim rsRecipient, stSearchString
Set oArgs = WScript.Arguments
stSearchString = oArgs(0)
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=ADSDSOObject"
strQuery =
"<LDAP://<yourServer>/cn=Recipients,ou=<yourSite>,o=<yourOrg>>;(&(objectClas
s=organizationalPerson)(rdn=" & stSearchString & "));mail;subtree"
Set rsRecipient = CreateObject("ADODB.Recordset")
rsRecipient.PageSize = 10
rsRecipient.Open strQuery, conn
rsRecipient.MoveFirst
do while not rsRecipient.EOF
on Error Resume Next
WScript.Echo rsRecipient.fields(0)
rsRecipient.MoveNext
loop
rsRecipient.Close
conn.Close
Set rsRecipient = Nothing
Set conn = Nothing
____________________________________________________________________
Ronny Lundberg, MCSE http://www.forv.mh.se/IT/RonnyLundberg
Dep. of IT-Services http://www.forv.mh.se/IT
Mid Sweden University mailto:[EMAIL PROTECTED]
Holmgatan 10 Phone: +46 (0)60-148766
851 70 Sundsvall Mobile:+46 (0)70-5588930
Sweden Fax: +46 (0)60-148950
____________________________________________________________________
-----Ursprungligt meddelande-----
Fr�n: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Skickat: den 28 augusti 2001 20:40
Till: Exchange Discussions
�mne: How to lookup Exchange SMTP addresses for a specified mailbox
alias
I'm writing an ASP page that is going to run on an IIS server (versions 4
and 5). This ASP page needs to be able to look up the SMTP address(es) for
a specified mailbox alias on Exchange 5.5 and 2000. I wrote some code to
do it using LDAP and Active Directory for Exchange 2000 but I'm struggling
to find a way to do it in Exchange 5.5. Anyone do this before or have any
ideas?
Also, is there a way to programmatically determine if I'm connected to an
Exchange 2000 server or an Exchange 5.5 server?
Thanks,
Mike
_________________________________________________________________
List posting FAQ: http://www.swinc.com/resource/exch_faq.htm
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe: mailto:[EMAIL PROTECTED]
Exchange List admin: [EMAIL PROTECTED]
_________________________________________________________________
List posting FAQ: http://www.swinc.com/resource/exch_faq.htm
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe: mailto:[EMAIL PROTECTED]
Exchange List admin: [EMAIL PROTECTED]