Hey Hey,

Here's a repost of something I posted in addicts, I wanted to open it up to everyone and see if I got more of a response. My friend and I were talking about this last night and we were wondering if it was some kind of built in security, that you can only set one users password remotely? Anyone heard of anything like this. He could simple logoff/logon between everyone but if he creates 500 users, that's 1000 logged events and he doesn't want to start flooding the event logs while he does it.

Anyways here's the original post.


<---Reposted from Addicts--->
Hey Hey,


A buddy of mine is working on some code to add users to the active directory. However it's having some major errors that we can't seem to locate.



code:--------------------------------------------------------------------------------
const strSERVER = "192.168.81.3" 'SERVER IP HERE
const strDOMAIN = "testdomain" 'DOMAIN NAME HERE
const strDOMSUFFIX = "ca" 'DOMAIN SUFFIX HERE
const strUSERNAME = "Administrator" 'DOMAIN ADMIN ACCOUNT
const strPASSWORD = "" 'DOMAIN ADMIN ACCOUNT PASSWORD

dim dso
dim objOU, objUSER

'sets the data source object to manage a data source (ldap)
set dso = GetObject("LDAP:")

'Open data source object to modify
'COMMAND: dso.openDSObject(server&path,account,password,connection type)
Set objOU = dso.openDSObject("LDAP://"&strSERVER&"/CN=Users,DC="&strDOMAIN&",DC="&strDOMSUFFIX,strUSERNAME&"@"&strDOMAIN&"."&strDOMSUFFIX,strPASSWORD,0)

'Create User H_SACKS
Set objUSER = objOU.create("User","CN=H_SACKS")
objUSER.Put "sAMAccountName", "H_SACKS"
objUSER.Put "description", "TESTUSER"
objUSER.SetInfo 'Commit changes

'Set password and enable account (has to be done after object is created)
objUSER.SetPassword "C0mPleXPA55"
objUSER.AccountDisabled = False
objUSER.SetInfo 'Commit changes

'Create User B_MARLEY
Set objUSER = objOU.create("User","CN=B_MARLEY")
objUSER.Put "sAMAccountName", "B_MARLEY"
objUSER.Put "description", "TESTUSER"
objUSER.SetInfo 'Commit changes

'Set password and enable account (has to be done after object is created)
objUSER.SetPassword "C0mPleXPA55" '**Error Returned Here**
objUSER.AccountDisabled = False
objUSER.SetInfo 'Commit changes

set dso = Nothing 'close data source connection
--------------------------------------------------------------------------------



The returned error is:
char: 1
error..: one or more input parameters are invalid
code: 80005008
source: active directory

This error is returned at the second SetPassword command. Which I have identified in the code with **Error Returned Here**.

Anyone got any ideas?

HT


<---End Repost--->