• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Mass create users in exchange 2003

I need to create a couple thousand users for testing on my exchange 2003 server.  Does anyone know of a script or a program that I can use to make thousands of users?
0
Lysandus
Asked:
Lysandus
  • 4
  • 4
  • 3
  • +2
3 Solutions
 
Pete LongTechnical ConsultantCommented:
Create Users Script

This script was written by user "Jumble" in Q_20678555

It will create 1000 active directory users named UserNo1, UserNo2 etc
Script Code
Cut below
============================================
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
                            objRootDSE.Get("defaultNamingContext"))

For i = 1 To 1000
   Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
   objLeaf.Put "sAMAccountName", "UserNo" & i
   objLeaf.SetInfo
Next
WScript.Echo "1000 Users created."
=============================================

This will create as many  users as you want edit as needed remember to save this as a .vbs file for it too work
0
 
Irwin SantosComputer Integration SpecialistCommented:
0
 
Pete LongTechnical ConsultantCommented:
once you have then created - open active direcotry users and computers > users > select them all

Right click them > enable
Right click them > Exchange Tasks > Create mailbox

go and have a coffee

When you come back log in as the domain administrator - open outlook {or outlook web access} and send a blank email to each oth these users (select them all fromt he global address list)

now look in exchange system manager and you will have 1000 mailbox's
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
LysandusAuthor Commented:
For that script, is the password set blank or something else?
0
 
Pete LongTechnical ConsultantCommented:
blank :)
0
 
LysandusAuthor Commented:
Do you know how I can modify the script to set the password to something specific?
0
 
Pete LongTechnical ConsultantCommented:
not modify that script but - once you hace created your users move them to an OU Called TEST then

' StudentPwd.vbs
' Example VBScript to change a user's password
' Version 2.0 - August 2005
' ---------------------------------------------------------'
Option Explicit
Dim objOU, objUser, objRootDSE
Dim strContainer, strDNSDomain, strPassword
Dim intCounter, intAccValue, intPwdValue

' --------------------------------------------------------'
' Note: Please change OU=nowhere, to reflect your domain
' --------------------------------------------------------'
strContainer = "OU=TEST, "
strPassword = "H0l1d@y$"
intAccValue = 544
intPwdValue = 0
intCounter = 0
' -------------------------------------------------------'
' Makes the user change H0l1d@y$ password at first logon
' -------------------------------------------------------'

Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
strContainer = strContainer & strDNSDomain
set objOU =GetObject("LDAP://" & strContainer )

For each objUser in objOU
If objUser.class="user" then
objUser.SetPassword strPassword
objUser.SetInfo
objUser.Put "pwdLastSet", intPwdValue
objUser.SetInfo

objUser.Put "userAccountControl", intAccValue
objUser.SetInfo
intCounter = intCounter +1
End if
next

WScript.Echo strPassword & " is Password. UserAccountValue = " _
& intAccValue & vbCr & intCounter & " accounts changed"
WScript.Quit

' End of change password example VBScript


Sets all the passwords to H0l1d@y$

Ref http://www.computerperformance.co.uk/ezine/ezine83.htm
0
 
LysandusAuthor Commented:
Awesome, I'll give this a try.
0
 
Stacy SpearPresident/Principal ConsultantCommented:
If you are stress testing the server, use JetStress from Microsoft. A couple of thousand users without mail flow or disk IO won't stress a a good server at all.


http://www.microsoft.com/downloads/details.aspx?FamilyID=94b9810b-670e-433a-b5ef-b47054595e9c&DisplayLang=en
http://www.microsoft.com/downloads/details.aspx?FamilyId=773AE7FD-860F-4755-B04D-1972E38FA4DB&displaylang=en 
(this one can be dangerous but I love it on a test bed) http://www.microsoft.com/downloads/details.aspx?FamilyID=92eb2edc-3433-47ca-a5f8-0483c7ddea85&DisplayLang=en
0
 
Irwin SantosComputer Integration SpecialistCommented:
@redseatechnoloiges...you need to include me in the split as I provided a valid link to the question being asked...within the above link the direction was to "look at the links below"..specifically "Read the details on Visual Scripting".  The contents within describe with illustration how to accomplish what was asked in the original question.
0
 
Irwin SantosComputer Integration SpecialistCommented:
@redseatechnoloiges...oh yeah... please :-)
0
 
redseatechnologiesCommented:
I did see that, but thought that a commercial solution was not required (and not what the asker went for in the end anyway).

The reason I included darkstar in the split was because she (i think I got that right) gave other links for stress testing.

If it wasn't going to be a split between those two, it was going to be a direct accept to Pete.

Although, I can see that the asker did ask for either a script _or_ a program, so I will leave the decision up to the attending mod.

-red
0
 
Irwin SantosComputer Integration SpecialistCommented:
@redseatechnoloiges...well, I saw program and that was my focus.
0
 
Stacy SpearPresident/Principal ConsultantCommented:
Red, I'm a HE! :)

True, asker did ask for a script but reading into his question, it seems that he was trying to ensure a new server was good enough to keep his pay check coming in. And jetstress and IOMeter (available at Sourceforge) does stress a disk subsystem, while the others stress all the components.

Hopefully, the asker would resolve the question before the mods do, then irwinpks, the right choice is made for accepted answer. I see lots of mod closed questions that I feel I should have gotten the points but didn't. Its just too much cleanup work to be done for every question to be closed properly when the asker abandons it.
0
 
redseatechnologiesCommented:
>>Its just too much cleanup work to be done for every question to be closed properly when the asker abandons it.

You have no idea.  I spent 5 hours going through it today...
0
 
Stacy SpearPresident/Principal ConsultantCommented:
I had some idea, my inbox full of redsea comments! Got to commend you, I never have the time to spend that much on EE.
0
 
redseatechnologiesCommented:
Lol, yeah, think about what Sembee got when he woke up :))

Anyway, lets try to keep on topic so that we don't upset the mod!

-red
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 4
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now