Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding 200 new users 2

Status
Not open for further replies.

pudsey41

MIS
Jun 15, 2002
12
GB
please could someone point me in the right direction ...
i have been left in the lurch and have to add 210 new users to our school network .... is there a "cheap" easy way to do this in bulk instead of having to add 1 at a time

Peter Moulson
Pudsey Grangefield High School
Leeds, UK
 
There are some tools around to do this for you. One is called Advantage and I think Hyena will do it also.
 
Create a batch file using adduser.exe from the resource kit or by downloading it.
 
Nick, I followed your advice, and found HYENA being a pretty good software program. I am impressed - didn't know it existed. How do you create your 200 users from this program, with the macro?
 
Here's a vb script I used to create test users on a test domain. You will have to edit it. For the domain controller DC1.Domain.Lan, it creates an OU called my company, creates two sub OUs in it called domain_lan users and my groups. I adds users with the username starting at User100 to User159, and even inserts their profile path (you have to create the folder and share the path for it). After that, it creates a few test groups (must be in native mode for the groups to be created right). You can get scripting like this from microsoft. look for netscrpt.exe and scriptomatic.exe from their downloads. They're full of good examples on working with Active directory through scripts. I'm sure this script could have been written better, but hey, it worked so I'm not complaining.



strdom = "dc=DOMAIN,dc=LAN"
strmyou = "ou=My Company"
strmyusrs = "ou=Domain_Lan Users"
strmyusrname = "User"
strmyprofilepath = "\\DC1\Profiles$"


stroud = strmyou & "," & strdom

Set objDomain = GetObject("LDAP://" & strdom)
Set objOU = objDomain.Create("organizationalUnit", strmyou)
objOU.SetInfo

Set objDomain = GetObject("LDAP://" & stroud)
Set objOU = objDomain.Create("organizationalUnit", strmyusrs)
objOU.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 100 To 159
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objLeaf.Put "sAMAccountName", strmyusrname & i
objLeaf.SetInfo
Set objUser = GetObject("LDAP://cn=" & strmyusrname & i & "," & strmyusrs & "," & stroud)
objUser.AccountDisabled = FALSE
objUser.Put "UserPrincipalName", strmyusrname
objUser.Put "ProfilePath", strmyprofilepath & "\" & strmyusrname & i
objUser.SetInfo
next

Set objDomain = GetObject("LDAP://" & stroud)
Set objOU = objDomain.Create("organizationalUnit", "ou=My Groups")
objOU.SetInfo

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users10xG")
objGroup.Put "sAMAccountName", "Users10xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 100 To 109
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users11xG")
objGroup.Put "sAMAccountName", "Users11xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 110 To 119
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users12xG")
objGroup.Put "sAMAccountName", "Users12xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 120 To 129
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users13xG")
objGroup.Put "sAMAccountName", "Users13xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 130 To 139
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users14xG")
objGroup.Put "sAMAccountName", "Users14xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 140 To 149
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users15xG")
objGroup.Put "sAMAccountName", "Users15xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://" & strmyusrs & "," & stroud)
For i = 150 To 159
Set objLeaf = objContainer.Create("User", "cn=" & strmyusrname & i)
objGroup.Add objLeaf.ADSPath
next

Set objOU = GetObject("LDAP://ou=My Groups," & stroud)
Set objGroup = objOU.Create("Group", "cn=Users13xto15xG")
objGroup.Put "sAMAccountName", "Users13xto15xG"
objGroup.SetInfo

Set objContainer = GetObject("LDAP://ou=My Groups," & stroud)
Set objLeaf = objContainer.Create("Group", "cn=Users13xG")
objGroup.Add objLeaf.ADSPath
Set objLeaf = objContainer.Create("Group", "cn=Users14xG")
objGroup.Add objLeaf.ADSPath
Set objLeaf = objContainer.Create("Group", "cn=Users15xG")
objGroup.Add objLeaf.ADSPath
 
Hello. I am new to this thread but have the same exact problem as arlem. I have Hyena but can't figure out how to create 200+ users. I don't have to use Hyena if somebody can guide me to a much simpler way or resource so that I can figure this out.

I work at a year-round school where we always have a +50 / -50 student enrollment every month. So knowing how to do this would be a huge time saver. School is about to start and we are trying to create up to 400 users with roaming profiles.

Thank you for your help!

Kevin
 
win2k server only

i'm a school network manager and have had little problems, creating the accounts, its easy, export the new students from SIMS(or Like)into a csv file format. access within Excel and format to the 'csvde' format required(see technet for more details), ensuring you have headers seperated with commas. the hard part is gettin the ou correct in the 'dn' field, so have a play around, using the command prompt 'csvde -i -f c:\bulkupl.csv' it created 330 accounts in about 3 mins. if you want to know what fields to use, do a reverse of the import ie 'csvde -f c:\bulkexp.csv' then import that csv into excel, it should give you all the existing objects within AD.

if you get it right it's great, it's harder to ensure passowrds are to your requirement, i just left them with the default after upload, whic is no password to start with and must input one on first use.

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top