locked
How to query the Active directory using SQL Server 2005

    Question

  • Hi,

    I am trying to query Active server from Sql Server 2005 and getting error

    I used following script to create link server

    EXEC sp_addlinkedserver 'ADSI3', 'Active Directory Services 111', 'ADSDSOObject', 'adsdatasource'

    and then trying to connect using following statement

    SELECT

     

    * FROM OpenQuery(ADSI, 'SELECT * FROM ''LDAP://DC=local.mycompany.ca'' WHERE objectCategory=''User'' ')

    and getting following error

    An error occurred while preparing the query "SELECT * FROM 'LDAP://DC=local.resound.ca' WHERE objectCategory='User' " for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

    Please let me know if you know How to query the Active directory using SQL Server 2005

    Thanks,

    Raj

     

     


    Dreaming a world without any war in anywhere
    Thursday, September 09, 2010 7:57 PM

Answers

All replies