Hi,
I am using SQL Server and PHP 5 on a domain running active
directory.
I have a stored procedure that uses a linked server (called
ADSI) to
query AD. The procedure gets user information from AD and
sticks it in
a table. It runs fine in SQL Manager, but when I try calling
it from my
php web front end using this code:
$sql="EXEC updateADusers";
$result = odbc_db_sp($sql);
I get the following error:
37000 - [Microsoft][ODBC SQL Server Driver][SQL Server]An
error
occurred while preparing the query "SELECT name,
department,
physicalDeliveryOfficeName, telephoneNumber, mail FROM
'LDAP://
DC=mydomain' WHERE objectCategory='User' AND mail='*'
" for execution
against OLE DB provider "ADsDSOObject" for
linked server "ADSI".
NB: mydomain is properly defined in the real query, but I
can't post it
up here, sorry.
I have an odbc connection set up, and the website uses this
to get info
from the database, which all works fine. I just need to be
able to run
this stored procedure from the front end. I have given the
builtin/admins, local service and inet accounts access to
the linked
server. Also, the odbc uses an AD user to connect to sql. I
have mapped
this user as a login in sql and given rights to the database
and linked
server.
Please can someone shed some light on this for me?
Thanks.
|