Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 276915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:59:32+00:00 2026-05-12T00:59:32+00:00

I can setup a connection manager that uses the Directory Services OLE provider and

  • 0

I can setup a connection manager that uses the Directory Services OLE provider and points to one of our domain controllers. Then, in the Data Flow area, I create an OLE DB Source and set the Data Access Mode to "SQL Command".

I then use this query to pull data from Active Directory:

Select employeeid, sAMaccountName
From 'LDAP://MyCompany.com'
Where objectClass = 'user'
  and objectClass = 'Person'
  and objectClass <> 'Computer'

If I parse the query, it says that it parses correctly. If I open the Query Builder, it gives me this error.

Error in FROM clause: near ‘WHERE’. Unable to parse query text.

I then click OK and it opens the Query Builder where I can successfully run the query and get results from AD. However, when I try to click OK to apply the changes or go into the Columns view, I get this error:

Error at Data Flow Task [OLE DB Source 1 [941]]: An OLE DB error has occurred. Error code: 0x80040E21.

ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)

I have also tried setting up the DB source using the "SQL command from variable" Access Mode. I set up a string variable with the value being the query… but that just gives me the same error.

Because the error is so generic, I can’t seem to find a description of what is actually wrong.

Does anyone know how to successfully use the OLE DB Provider for Microsoft Direcotry Services? And/or does anyone know a better way to do this inside of SSIS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:59:32+00:00Added an answer on May 12, 2026 at 12:59 am

    Assuming you named the linked server (your Active Directory OLE DB provider) “ADSI”, here’s essentially what you’d need:

    SELECT samAccountName,
           employeeID
    FROM OPENQUERY(ADSI,
      'SELECT samAccountName, employeeID
       FROM ''LDAP://MyCompany.com''
       WHERE objectClass=''Person''
       AND objectClass = ''User''
       AND NOT objectClass = ''Computer''')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you need to use some kind of provider? Can you setup your own
From where I can download Turbo C++ setup, the one with blue srceen which
The Setup: I have a DLL that uses a ConnectionString to connect to a
How can I setup connection pooling in Spring MVC? I am working on an
Can I setup a custom MIME type through ASP.NET or some .NET code? I
How can I setup a shared ccache without falling into a permissions problem? I
How can I setup a default value to a property defined as follow: public
I can correctly setup up a windows hook, but I get confused by the
Can anybody provide some instruction on how to setup a war file to show
How can I debug a .NET setup project?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.