LDAP query in SSIS
Hi All,
I am using
SELECT Name, DescriptionFROM 'LDAP://localHost'
query to get data from active directory. Its working finein the Query builder and if i tries to preview i am getting error
like
Error at Data Flow Task [OLE DB Source [469]]: An OLE DB error has occurred. Error code: 0x80040E21.
(Microsoft Visual Studio)
===================================
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------Program Location:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ReinitializeMetaData() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowComponentUI.ReinitializeMetadata() at Microsoft.DataTransformationServices.DataFlowUI.DataFlowAdapterUI.connectionPage_SaveConnectionAttributes(Object sender, ConnectionAttributesEventArgs args)
can any one help me to get the answer.
Regards,
Murali.
September 18th, 2008 9:56am
See if this post from John's blog can help you:http://agilebi.com/cs/blogs/jwelch/archive/2007/04/07/retrieving-information-from-active-directory-with-ssis.aspx
Free Windows Admin Tool Kit Click here and download it now
September 18th, 2008 4:28pm
Hi,
It is working fine but if i check the data for 'Description' column i am getting System.Object[], for other columns i am getting correct Data. What is the problem with Description column.
September 23rd, 2008 8:12am
Now i am getting correct data.I made some corrections in vb.net srcipt.
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Public Class ScriptMain
Inherits UserComponent
Public Overrides Sub CreateNewOutputRows()
Dim oledbAdapter As New OleDb.OleDbDataAdapter
Dim dataTable As New System.Data.DataTable
Dim dataRow As Data.DataRow
Dim delimitedValues As String
Dim i As Integer
oledbAdapter.Fill(dataTable, Me.Variables.userObjects)
For Each dataRow In dataTable.Rows
Output0Buffer.AddRow()
delimitedValues = String.Empty
For i = 0 To dataRow.ItemArray.GetUpperBound(0)
delimitedValues = delimitedValues + dataTable.Columns(i).ColumnName + "="
If DirectCast(dataRow.Item(i).GetType(), System.Type).BaseType.Name = "Array" Then
Dim arr() As Object
arr = CType(dataRow.Item(i), Object())
delimitedValues = delimitedValues + arr(0).ToString()
Else
delimitedValues = delimitedValues + dataRow.Item(i).ToString()
End If
If i <> dataRow.ItemArray.GetUpperBound(0) Then
delimitedValues = delimitedValues + ","
End If
Next
Output0Buffer.Column = delimitedValues
Next
End Sub
End Class
Regards,
Murali.
Free Windows Admin Tool Kit Click here and download it now
September 29th, 2008 9:39am
Hi Murli,Can you post the detail about your package? Just steps would be enough.Thanks,
April 3rd, 2009 2:50am
Hi,
Can you provide step-by-step instruction of the package - I have a request to query the roomNumber from Active Directory
Thanks,
-NR
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 2:28pm
This thread is quite old, perhaps you should open a new one? Arthur My Blog
May 31st, 2011 2:32pm