>I'm helping someone automate user login creation, and they want to add new members to an existing group.
>
>The PutEx() function I need to call is defined as:
>Method PutEx(lnControlCode As Long, bstrName As String, vProp As Variant) As Void
>
>The example code gives vProp as [Array("cn=userid1, dc=domain, dc=com", "cn=userid2, dc=domain, dc=com)] to add userid1 and userid2 to previously selected group.
>
>Various attempts to pass vProp with the string "Array" included have failed with OLE IDispatch exception code 0 from Active Directory: Unspecified Error.
>
>How can I pass it what it is expecting from FoxPro?
Chris,
Where do you need to call this? If I understand you correctly, the following will do what you want:
local locomputer, louser, logroup
locomputer = getobject('WinNT://MyDomain/MyComputer,computer')
louser = locomputer.Create('user','NewUser')
louser.SetPassword('mynewpassword')
louser.SetInfo()
logroup = getobject('WinNT://MyDomain/MyComputer/GroupName,group')
logroup.Add('WinNT://MyDomain/MyComputer/NewUser')
Does it need to do something else that I'm missing?
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao