dbTalk Databases Forums  

DTS pkg can not access AD security group??

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS pkg can not access AD security group?? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Hefferon
 
Posts: n/a

Default DTS pkg can not access AD security group?? - 12-16-2003 , 09:14 AM






Hi all:
I am getting an error when executing an ActiveX script task within a
DTS package. To the best of my abilities I have verified that the
actual account running the DTS has the appropriate Windows account
permissions and have tried scheduling the package as a job ... all
with the same result:

Error code -2147463168 ("An invalid Active Directory pathname was
passed").

The VBScript is below. The offending statement is the one that tries
to instantiate an ADsGroup object:
Set oADsGroup = GetObject(strADsPath)

This line of code (& the whole function w/ some ASP modifications)
work as desired when run from an ASP page.

Some more background on our environment ... The DTS package (and
scheduled job) both run under the administrator account for the
relevant AD domain. SQL Server and Active Directory run on 2
different machines, both of which are domain controllers for the
domain in question (see 'project' below). The IIS server, on which my
test ASP page executed correctly, is on the AD server (temporarily).
Also, the group is a Global-Security type group.

Initially, I thought this was a permissions problem but didn't
understand why the Domain Admin (who is running the DTS package & job)
wouldn't have the necessary permissions while the anonymous IIS user
(presumably the account executing the ASP code) would!?!? Can anyone
share a solution to a similar situation or even just suggest
some next debugging steps (I'm fresh out)?
Thanks,
Chris H.
--------------
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
'On Error Resume Next

'*** Declare Active Dir obj variables
Dim oADsGroup, strADsPath
Dim oUser, oADsMembers, strUser

strADsPath="LDAP://project/cn=mygroup,dc=project,dc=com"

'** Declare and initialize ADO param obj variables
Dim adVarChar
adVarChar = 200
Dim adParamOutput
adParamOutput = 2
Dim adParamInput
adParamInput = 1
Dim param, param_out, strProcStatus, taskStatus
Dim conn, strConn

Set conn=CreateObject("ADODB.Connection")
strConn = "Provider='sqloledb';Data
Source='MyServer';Initial Catalog='MyDatabase';"
conn.ConnectionString = strConn
conn.open

Dim cmd
Set cmd = CreateObject("ADODB.Command")

cmd.ActiveConnection = conn
cmd.CommandText = "sp_ins_adsGroup_User"

'*** Create ADS Object
Set oADsGroup = GetObject(strADsPath)
Set oADsMembers = oADsGroup.Members()

taskStatus = DTSTaskExecResult_Success

for each oUser in oADsMembers
strUser = oUser.get("sAMAccountName")

Set param = cmd.CreateParameter("@ads_user_id", adVarChar,
adParamInput, 32, strUser)
cmd.Parameters.Append param
Set param_out = cmd.CreateParameter("@tran_status", adVarChar,
adParamOutput, 7)
cmd.Parameters.Append param_out
cmd.CommandType = 4

cmd.Execute
strProcStatus = .Parameters("@tran_status").value
'MsgBox "User, " & strUser & " - " & strProcStatus
If strProcStatus <> "success" Then
taskStatus = DTSTaskExecResult_Failure
End If
cmd.Parameters.delete 1
cmd.Parameters.delete 0
set param = nothing
set param_out = nothing
next

set cmd = nothing
conn.close
set conn = nothing

Main =taskStatus

End Function

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.