Quick way of adding 200 AD accounts and Exchange mailboxes

automationexchangeexchange-2003

So if someone has a list of 200 names and they want to quickly add ActiveDirectory users and Exchange mailboxes for each one, are there any tools/techniques that can help with that?

Details:

  • Exchange 2003
  • List of 200 names in Excel/CSV file
  • Add an AD user
  • Then add an Exchange mailbox
  • External contacts needed for each user, with email address
  • Enable dual delivery for each mailbox

Best Answer

VBScript and ADSI for creating the user accounts. Use something like this to get started:

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."

From here.

The Microsoft Technet Script Center also has loads of sample scripts for just about anything you might wish to do, and is a great resource.

For mailboxes I wouldn't bother scripting; just create all the users in the same OU, then block-select them (in ADU&C), right click, and do the "Exchange Tasks" thing - much quicker and less prone to error.

Related Topic