Question

Locked

Help Creating User in AD using script

By elmaestro2001 ·
Hello Guys! I download Create users in Active Directory from a CSV file with this VBScript from this page and is really helpful for me, my question is how do I add this users to a OU or a group?

Please need your help

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

visit "hey scripting guy"

by CG IT In reply to Help Creating User in AD ...

lots of AD scripts for this.

Collapse -

hey scripting guy

by elmaestro2001 In reply to visit "hey scripting guy"

I know that there are a lot, I have one but the one that I have doesn't let me add the group or the OU where the users will be

Collapse -

Post the script or a link to it

by neilb@uk In reply to Help Creating User in AD ...

and we'll see what's missing. You should certainly be able to place your new user into any preferred OU without any problems.

Collapse -

yep

by CG IT In reply to Post the script or a link ...

if you looked in "Hey Scripting Guy"

http://gallery.technet.microsoft.com/ScriptCenter/en-us/b9c5**4e-86cc-4b2b-8b7d-6a82ab2b465d

you would have found this script.

VBScriptSet objDomain = GetObject("LDAP://dc=fabrikam,dc=com")
Set objOU = objDomain.Create("organizationalUnit", "ou=Management")
objOU.SetInfo

Set objOU = GetObject("LDAP://OU=Management,dc=fabrikam,dc=com")
Set objUser = objOU.Create("User", "cn= AckermanPilar")
objUser.Put "sAMAccountName", "AckermanPila"
objUser.SetInfo

Set objOU = GetObject("LDAP://OU=Management,dc=fabrikam,dc=com")
Set objGroup = objOU.Create("Group", "cn=atl-users")
objGroup.Put "sAMAccountName", "atl-users"
objGroup.SetInfo

objGroup.Add objUser.ADSPath

and that script creates an new OU, the account blah blah... you modify the script

http://gallery.technet.microsoft.com/ScriptCenter/en-us/d0498d58-a38c-4d18-9e7c-7868e4d0a7b9


'Step 1 : Move USER account from the specific OU to the other OU

set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objcommand.ActiveConnection = objConnection

which is only part of the script... leave it up to you to complete it.

Back to Software Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums