I'm looking for cut and paste code that will allow me to connect to my
Exchange gal using mapi, not active directory.
User Name: Peter
Pass: Password12
Exchange Server Name: ExchnageTest
Domain: Continental
I would like it to be a linked server if possible.
I want to be able to import all field in the GAL. |
Clarification of Question by
pmclinn-ga
on
16 Jan 2003 19:11 PST
I'm looking to link SQL Server 2000 to a Exchange server using mapi.
|
Request for Question Clarification by
cerebrate-ga
on
17 Jan 2003 04:56 PST
Just so I'm absolutely certain of the desired result: you want to be
able to access the Exchange GAL as if it was a "table" in SQL Server?
|
Clarification of Question by
pmclinn-ga
on
17 Jan 2003 14:06 PST
Exactly...I want to access the exchange gal from sql server 2000 as if
it was a table. I'm hoping it can be done by using mapi.
|
Request for Question Clarification by
cerebrate-ga
on
18 Jan 2003 06:17 PST
I am afraid that my research and experimentation indicates to me that
this isn't possible through MAPI, or through the Exchange OLE DB
provider for SQL Server (which allows you to access objects in the
Exchange Information Store, which unfortunately does not include the
GAL).
The best I have been able to locate is a technique to expose the GAL
information as an SQL Server *view*, by querying through the OLE DB
Provider for Microsoft Directory Services - however, this obtains the
GAL information by querying Active Directory rather than going through
MAPI. You indicate in your original question that you don't want to
use AD to source the information, but I thought I'd offer this option
anyway in case you were referring to wanting it as a SQL table rather
than ADSI, which this would satisfy.
If not, I'm afraid I'll have to leave this one for another researcher
to pick up, as I've been unable to locate any other possibilities.
Regards,
cerebrate-ga
|
Clarification of Question by
pmclinn-ga
on
18 Jan 2003 07:31 PST
Active directory is not running on our network.
Even if there was a way to use query analyzer to query against the gal
and then make a table and append the data.
I was hoping a DLL might work too....
|
Request for Question Clarification by
cerebrate-ga
on
18 Jan 2003 08:31 PST
Ah, an earlier Exchange than I was thinking of. Now I'm with you.
Unfortunately, my earlier research still applies in that there's not
really a built-in way to do this. It could be done, DLL-wise, by
custom development - someone would need to write, effectively, an "OLE
DB Driver for MAPI/GAL" - but I'm afraid that would probably be rather
expensive.
With regard to your other proposal, using query analyser to mirror the
data across to SQL Server, I don't believe it could be easily done in
quite that way, but what I can certainly provide you with is a
VBscript which will perform the same operation - reading the GAL using
MAPI/CDO and placing the data from it into an SQL table. Let me know
if that script would be a satisfactory answer, and I'll get right on
it.
Regards,
cerebrate-ga
|
Clarification of Question by
pmclinn-ga
on
19 Jan 2003 11:41 PST
Right now I'm linking to an access database that pulls from Exchange
Gal. I'm going to hold out, there has to be a way of doing this...
|
Clarification of Question by
pmclinn-ga
on
20 Jan 2003 18:37 PST
I have lowered the dollar figure to $15.00. I will except an ADSI
linked server connection. Please use the parameters I supplied
earlier to create the string.
|
Clarification of Question by
pmclinn-ga
on
20 Jan 2003 19:51 PST
Please supply me with a connection string and a basic query to pull the info.
|
Request for Question Clarification by
cerebrate-ga
on
21 Jan 2003 05:08 PST
Before I post this as an answer, I just want to clarify one point: The
ADSI/OLE DB Driver for MS Directory Services *requires* Active
Directory/Exchange 2000 to be able to supply the information you
request, which is why I discounted it in my most recent clarification.
As you've said that you aren't running Active Directory on your
network, are you certain you want this?
|
Clarification of Question by
pmclinn-ga
on
21 Jan 2003 06:30 PST
I downloaded a vb program last night that used adsi to pull down the
exchange Name, and e-mail via adsl. After our recent merger the
companany must have started using it. So... I will except an adsi
connection.
I've already added in the linked server via this command:
Exec sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5',
'ADSDSOObject', 'adsdatasource'
Unfortunately I haven't been able to pull any information yet.
|
Clarification of Question by
pmclinn-ga
on
22 Jan 2003 18:47 PST
I found another method of connecting to the gal. Could someone
explain how to take the information gathered by this script and give
me the code to dump the results into a table.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
set oConn = CreateObject("ADODB.Connection")
set oCommand = CreateObject("ADODB.Command")
set oRS = CreateObject("ADODB.Recordset")
oConn.Provider = "ADsDSOObject"
oConn.Open "Ads Provider"
set oCommand.ActiveConnection = oConn 'set the active connection
' A filter of (objectClass=person) will return mailboxes,
distribution lists, and custom recipients
strQry =" <LDAP://ENTMAEXCH02/o=Continental/ou=Northeast/cn=Recipients>;(&(objectClass=Person));cn,adspath,UID;subtree"
oCommand.CommandText = strQry
oCommand.Properties("Page Size") = 99
'paged query used to avoid Exchange LDAP server limits
set oRS = oCommand.Execute
oRS.MoveFirst
count = oRS.RecordCount
End Function
|