ActiveX script to grab all users in Active Directory and tranfer to SQL Server.
Hello,Does anyone has any idea, or information on how to write an ActiveX script to grab all the users from Active Directory and transfer it into a recordset, SQL server, etc..Really need help.Thank you very much.
November 30th, 2005 8:37am

I'm assuming that because this is a SSIS forum you are looking to use the SSIS ActiveX Script Task?Don't do it. That task is only there for DTS 2000 migrated packages. Use a Script Task instead.-Jamie
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2005 9:11am

I am using SQL Server 2000. So, I do want to use a script task, and that's what I have (code snippet):Dim conDim rsDim FileSystemSet FileSystem = WScript.CreateObject("Scripting.FileSystemObject")Set OutPutFile = FileSystem.CreateTextFile("marketing.txt", True) set con = CreateObject("ADODB.connection")set rs = CreateObject("ADODB.recordset") con.Provider = "ADsDSOObject"con.Open "Active Directory Provider"Set rs = con.Execute("<LDAP://MyServerName/DC=MyDomain>;(objectClass=User);ADsPath;onelevel") But when I execute I get an error message stating that table does not exist. That happens in the LDAP Provider. Any ides?Thank you.
November 30th, 2005 9:19am

This isn't a DTS forum. Try microsoft.public.sqlserver.dts on USENET/NNTP/newsgroups/whatever they're call these days.
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2005 10:02am

For other users trying to find the answer to this like I did, here is the solution: The simple version uses a data flow task. The data set being queried must be smaller than the paging file size on AD, and only single value attributes can be returned. http://dataqueen.unlimitedviz.com/2012/05/importing-data-from-active-directory-using-ssis/ The more robust version uses a C# script which is not affected by the paging file size. http://dataqueen.unlimitedviz.com/2012/09/get-around-active-directory-paging-on-ssis-import/ If you also want to include multi-value attributes such as Description then add this to your C# code. http://dataqueen.unlimitedviz.com/2012/09/how-to-query-multi-value-fields-in-active-directory-using-ssis/Martina White
September 30th, 2012 5:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics