Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    32

    Unanswered: Can't connect to linked AD server

    Dear Friends,

    select name As Name, sAMAccountName As UserName, title As Title,
    physicalDeliveryOfficeName As Office, telephoneNumber As PhNumber,
    mobile As CellPhone, facsimileTelephoneNumber As FaxNumber, mail As Email,employeeid as emp_no from openquery
    (
    ADSI,'SELECT name, sAMAccountName, title, physicalDeliveryOfficeName, mobile, facsimileTelephoneNumber, telephonenumber, mail ,employeeid
    FROM ''LDAP://fp1-srvr.sidf.gov.sa''
    WHERE objectCategory = ''Person''AND objectClass = ''user''
    ')

    on sql server 2000 it was working but when migration to sql server2005
    I got the following error when trying to excute on query analyzer:


    Msg 7321, Level 16, State 2, Line 1
    An error occurred while preparing the query "SELECT name, sAMAccountName, title, physicalDeliveryOfficeName, mobile, facsimileTelephoneNumber, telephonenumber, mail ,employeeid
    FROM 'LDAP://fp1-srvr.sidf.gov.sa'
    WHERE objectCategory = 'Person'AND objectClass = 'user'
    " for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".

    Could you please help me in that

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Have you got the AD source set up as a linked server?
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2008
    Posts
    32
    thanks for your reply ,yes ,I got it

    and this the script for creation.

    EXEC master.dbo.sp_addlinkedserver @server = N'ADSI', @srvproduct=N'Active Directory Services 2.5',
    @provider=N'ADsDSOObject', @datasrc=N'fp1-srvr.sidf.gov.sa'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'collation compatible', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'data access', @optvalue=N'true'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'dist', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'pub', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'rpc', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'rpc out', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'sub', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'connect timeout', @optvalue=N'0'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'collation name', @optvalue=null
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'lazy schema validation', @optvalue=N'false'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'query timeout', @optvalue=N'0'
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'use remote collation', @optvalue=N'true

  4. #4
    Join Date
    Apr 2008
    Posts
    32
    Any One could help me in this isssue.

  5. #5
    Join Date
    Apr 2008
    Posts
    32

    Solution

    Dear Friends

    I finaly found the solution :
    The one that seems to trip up most users is
    that the service account used by the sql agent service has to be a member of
    the DatabaseMailUserRole in the MSDB database

    this the silte:
    http://groups.google.com.sa/group/mi...6e373c96b9c7c2

    Thanks for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •