Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Connecting To Exchange with ASP

Author  Topic 

Kbalz
Yak Posting Veteran

94 Posts

Posted - 2005-10-04 : 14:57:26
I've read seemingly hundreds of How Tos for connecting to exchange... and a half dozen 'showing' how to do what I'm having trouble with.. I need some live help!

I'm attempting to connect to my Exchange 2003 server through ASP, and I want to grab the Global Address List (GAL). I am able inside of Microsoft Access link the Exchange() server to a database and load the GAL table.. I just having a hard time connecting to the exchange server. I'll check regualarly back if you need more inforamation, --Kurt

Kbalz
Yak Posting Veteran

94 Posts

Posted - 2005-10-04 : 14:59:48
I should have posted what I have so far hehe: here it is

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<HTML>
<BODY>
<CENTER><H2>Global Address List</H2><CENTER>

<%

Set oArgs = wscript.Arguments

if ( oArgs.Count <> 1 ) then
wscript.echo "Usage exchsrch alias"
wscript.echo "e.g cscript exchsrch.vbs andyhar"
wscript.quit(0)<br>
end if

Const ADS_SCOPE_SUBTREE=2
searchAlias = oArgs(0)
exchServer = "EDGEMX"
Set con = CreateObject("ADODB.Connection")
Set Com = CreateObject("ADODB.Command") 'Open a Connection object
con.Provider = "EXOLEDB"

con.Open "Active Directory Provider" ' Create a command object on this connection
Set Com.ActiveConnection = con ' set the query string
adsPath = "LDAP://" & exchServer & "/o=EdgeSweets"
Com.CommandText = "select Alias, Display Name from '" & adsPath
Com.Properties("Page Size") = 100
Com.Properties("Timeout") = 30 'seconds
Com.Properties("searchscope") = ADS_SCOPE_SUBTREE 'Define in ADS_SCOPEENUM
Com.Properties("Cache Results") = False
Set rs = Com.Execute
if ( rs.EOF = False ) then
wscript.echo "Alias = " & rs.Fields("UID").Value
wscript.echo "Name = " & rs.Fields("givenName").Value & " " & rs.Fields("sn")
wscript.echo "Title = " & rs.Fields("Title").Value
wscript.echo "Office = " & rs.Fields("physicalDeliveryOfficeName").Value
wscript.echo "Telephone = " & rs.Fields("telephoneNumber").Value
Set mailRc = GetObject(rs.Fields("ADsPath").Value )
wscript.echo "Manager = " & mailRC.Get("Extension-Attribute-1")
end if
%>
</BODY>
</HTML>


<html>
<head>

<title>Untitled Document</title>
</head>

<body>

</body>
</html>




I got most of it from the guides I read.
Go to Top of Page
   

- Advertisement -