How to get access to all mailboxes in Exchange 2000 Server using Exchange OLE DB provider

  • From: akzuva@xxxxxxxxxxx
  • To: exchangelist@xxxxxxxxxxxxx
  • Date: Wed, 3 Sep 2003 03:17:17 -0600

SQL Server 2000 and Exchange 2000 on same server

SQL Script as follows

if exists(select 1 from master..sysservers where srvname = 'E2KPF') 
 exec sp_dropserver 'E2KPF', 'droplogins'
 go
 EXEC sp_addlinkedserver 'E2KPF', 'Exchange OLE DB provider', 
 'exoledb.DataSource.1',
 'file:\\.\backofficestorage\ExchangeDomain\public folders'
 go 
-- Query for a list of Contact entries in a PF
select convert(varchar(50), "urn:schemas:contacts:sn") as LastName,
 convert(varchar(50), "urn:schemas:contacts:givenName") as FirstName
from openquery(E2KPF,
 'select "urn:schemas:contacts:sn",
  "urn:schemas:contacts:givenName"
  from scope(''shallow traversal of ".\TestSQLContacts"'')')

When I run the query I get the following error

Server: Msg 7399, Level 16, State 1, Line 2
OLE DB provider 'exoledb.DataSource.1' reported an error. Access denied.
OLE DB error trace [OLE/DB Provider 'exoledb.DataSource.1'
IUnknown::QueryInterface returned 0x80070005:  Access denied.].

SQL Server service logon Account is SQLAccount which is a member of
Administrators and a global security group SQLExchange
SQLExchange is a member of the role Exchange Full Administrator

SQLAccount is NOT a member of Domain Admin, Enterprise Admin or Exchange
Domain/Enterprise Servers

If I start SQL Server service (logon account as Administrator) the query
will complete correctly. As soon as I change the SQL Service to run using
logon SQLAccount the query fails

I have looked at Steve Bryants article but this has not helped
I guess this is a permissions problem but dont know what else to set

Please Advise ANYONE !!!


Other related posts:

  • » How to get access to all mailboxes in Exchange 2000 Server using Exchange OLE DB provider