query active directory in sql 2008

Posted on 2011-10-03
Last Modified: 2012-05-12
this is the query that i use
       'SELECT  mail, displayName, sAMAccountName, givenName, sn, cn,  userAccountControl
          FROM ''LDAP://''
          where objectClass = ''User'' order by cn')

and this works fine when i am on the sql server. but if i am on developer machine and use studio management, it gives me this error
An error occurred while preparing the query "SELECT  mail, displayName, sAMAccountName, givenName, sn, cn,  userAccountControl
          FROM 'LDAP://'
          where objectClass = 'User' order by cn" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".

any help is really appreciate
Question by:StewSupport
    LVL 9

    Accepted Solution

    Give this a shot.

    it could be a link error in your sql server, or just a querying issue.


    Author Closing Comment

    what i did to fix my problem is that i went into security in the create new link server wizard and click on the radio button that says use this login and specify the login. thanks

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now