Nov 05









Here is a script that creates 13000 users in one ou called Management:

users.vbs:

Set objRootDSE = GetObject(“LDAP://rootDSE”)

Set objContainer = GetObject(“LDAP://OU=Management,” & _

objRootDSE.Get(“defaultNamingContext”))

For i = 1 To 13000

Set objLeaf = objContainer.Create(“User”, “cn=UserNo_” & i)

objLeaf.Put “sAMAccountName”, “UserNo_” & i

objLeaf.SetInfo

Next

Here is a script that creates 13000 Groups in one ou called Management:

groups.vbs:

For i =  1 To 13000

Set objOU = GetObject(“LDAP://OU=Management,dc=qa,dc=example,dc=net”)

Set objGroup = objOU.Create(“Group”, “cn=UserGroup_” & i)

objGroup.Put “sAMAccountName”, “UserGroup_” & i

objGroup.SetInfo

Next

Here is a script that creates 13000 Users and Groups in one ou called Management:

users_groups.vbs:

For i =  1 To 13000

Set objOU = GetObject(“LDAP://OU=Management,dc=qa,dc=example,dc=net”)

Set objUser = objOU.Create(“User”, “cn= UserNo” & i)

objUser.Put “sAMAccountName”, “UserNo” & i

objUser.SetInfo

Set objOU = GetObject(“LDAP://OU=Management,dc=qa,dc=example,dc=net”)

Set objGroup = objOU.Create(“Group”, “cn=UserGroup” & i)

objGroup.Put “sAMAccountName”, “UserGroup” & i

objGroup.SetInfo

objGroup.Add objUser.ADSPath

Next

Leave a Reply

preload preload preload