ActiveX组件无法创建对象:'GetObject'Infopath

时间:2010-08-02 11:23:37

标签: active-directory

我正在尝试使用以下代码在ActiveDirectory中创建一个新用户:

Sub CTRL1_12_OnClick(eventObj)
 Set objOU = GetObject("LDAP://OU=Users,dc=mfcvt,dc=local")
 Set objUser = objOU.Create("User", "cn=MyerKen")
 objUser.Put "sAMAccountName", "myerken"
 objUser.SetInfo
End Sub

当我点击按钮CTRL1_12时,此代码设置为从Infopath运行。但是当我运行它时,我得到的就是这个错误:

Infopath cannot complete this action, because of an error in the form's code.    
The following error occurred:

        ActiveX component can't create object: 'GetObject'
        File:script.vbs
        Line:20

感谢您寻找

彼得

1 个答案:

答案 0 :(得分:0)