I am working on creating a SSIS package that needs to access Active Directory. I have created an ADO.NET connection and wrote a select LDAP query to pull back the records (see below). I am able to retrieve the data successfully, but one of the Active Directory attributes is returning System.Object[] instead of the department number I desire. Is there a way to successfully convert the System.Object into the real data using the query? Thanks in advance.
Example query:
SELECT department, departmentnumber, sAMAccountName
FROM 'LDAP://example.com' WHERE objectClass='User'
Results:
|department |departmentnumber |sAMAccountName|
|Hollywood |System.Object[] |ceastwood |
UPDATE: After my research I will add that I don't believe this LDAP SQL query is possible to use if it's returning System.Object. I found many great examples of using a script task to perform a similar operation like this one HERE
I created a console application and built it up to insert my Active Directory data right into SQL. I would recommend following along to the articles found on Stack Over Flow. They helped me a great deal to accomplish this task, even though it wasn't the way I wanted.