Sunday, March 25, 2012

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.

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|||

I am using SQL Server 2000. So, I do want to use a script task, and that's what I have (code snippet):


Dim con
Dim rs
Dim FileSystem
Set 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.

|||This isn't a DTS forum. Try microsoft.public.sqlserver.dts on USENET/NNTP/newsgroups/whatever they're call these days.sql

No comments:

Post a Comment