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!

How to make 500 mailbox enabled users quickly? 2

Status
Not open for further replies.
Jan 4, 2005
32
US
I'm in the process of moving our email clients off of a Solaris sendmail system because it crashes often and can't handle the load.
It finally crashed and won't come back up. I have about 500 mailboxes on it and wanted to know if there is a script out there that can make these accounts in Exchange 2003 running on a Windows 2003 server? I don't believe there is a migration tool for these 2 systems but is there a script out there that can do this from an Excel spreadsheet?

If someone knows any way to make this faster, I would greatly appreciate the assistance.

TY!
 
If you can export the users in to a CSV file, you can manipulate that file and then import them using the CSVDE utility. If you could export them to an LDF file, you could use LDIFDE to import them. If the Solaris system is completely dead, the you probably don't have a "source" directory from which to export the data. I think your big challenge will be getting the user information in to a text file (information such as UserName, FirstName, LastName, etc... with UserName being the most important.)

Microsoft has a good TechNet article on how to do this:
and (Sorry for such long URLs)

There is 3rd party tool that simplifies this some called User Resource Administrator (
Once you have the users created in Active Directory, you can select all of them in a particular OU, right click, Exchange Tasks, and create mailboxes.

Good luck!
 
You don't say if these users already exist in AD or not. If they do then select all users, right click and choose Exchange Tasks. Choose Create Mailbox.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Thank you all for the wonderful links. The users don't exsist in AD yet so I will be using a script to do that and although I think it would be great to be able to select all and set them up with mailboxes that way...problem is, they all belong to different domains. We host about 200 web sites and each site is entitled to email as well. I'll have to look over the scripts more closely to see if I can encourporate that detail as well.

Thank you very much!
 
Something to get you started:

Code:
'==========================================================================
'
' NAME: createNewUsers.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 04/21/2003
' COPYRIGHT 2003 The Spider's Parlor, All Rights Reserved
'
'    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
'    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
'    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'    PARTICULAR PURPOSE.
'
'    IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS 
'    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
'    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
'    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
'    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
'    OF THIS CODE OR INFORMATION.
'
'
' COMMENT: 
' Creates users based on Excel spreadsheet information.
' Excel spreadsheet  formatting:
' Row 1 to have headings
' Column A (1) to have login
' Column B (2) to have first_name 
' Column C (3) to have last_name  
' Column D (4) to have phone      
' Column E (5) to have extension  
' Column F (6) to have fax        
' Column G (7) to have email      
' Column H (8) to have street     
' Column I (9) to have suite     
' Column J (10) to have city  
' Column K (11) to have state      
' Column L (12) to have zip    
'=====================================

set x = getobject(,"excel.application")
r = 2

Const c = "US"
Const co = "UNITED STATES"
'Change the following with your company info
Const company = "Company XYZ"
Const ou_name = "Users"

do until len(x.cells(r, 1).value) = 0

    login      = x.cells(r, 1).value
    first_name = x.cells(r, 2).value
    last_name  = x.cells(r, 3).value
    phone      = x.cells(r, 4).value
    extension  = x.cells(r, 5).value
    fax        = x.cells(r, 6).value
    email      = x.cells(r, 7).value
    street     = x.cells(r, 8).value
    suite      = x.cells(r, 9).value
    city       = x.cells(r, 10).value
    state      = x.cells(r, 11).value
    zip    =cstr(x.cells(r, 12).value)


    
'Change the following with the proper LDAP path for your network.
    set o = getobject("LDAP://SERVER.XYZ.com.local/CN=Users,DC=XYZ,DC=com,DC=local")

    if err then
        x.cells(r, 15).value = err.number & ":  " & err.description
        err.Clear
    end if
    

   Set oUser = o.Create("user","CN=" & Cells(r,1).Value)
   For j = 2 To Columns.Count

	if len(Cells(r,j).Value) = 0 then 
       Cells(r,j).Value = " " 
    end If

    if fn + ln = 0 then 
       fullName = x.cells(r, 1).value 
    else 
       fullName = first_name & " " & last_name
    end if



     oUser.Put Cells(1,j).Value, Cells(r,j).Value
     oUser.SetInfo
   Set oUser = Nothing
   Next

  
  
            
	
    


	
    Set oUser = o.Create("user","CN=" & fullName)
    oUser.Put "sAMAccountName", login
    oUser.SetInfo
    oUser.Put "userPrincipalName", email
    oUser.SetInfo
    oUser.Put "c", c
    oUser.Put "co", co
    oUser.Put "company", company
    oUser.Put "displayName", first_name & " " & last_name
    oUser.Put "facsimileTelephoneNumber", fax
    oUser.Put "givenName", first_name
    oUser.SetInfo
    oUser.Put "l", "Phoenix"
    oUser.Put "mail", email
    oUser.Put "mailNickname", login
    'oUser.Put "name", first_name & " " & last_name
    oUser.Put "otherTelephone", "Ext. "& extension
    oUser.Put "postalCode", zip
    oUser.SetInfo
    oUser.Put "sn", last_name
    oUser.Put "st", state
    oUser.Put "streetAddress", street & vbCrLf & Suite
    oUser.Put "telephoneNumber", phone & "Ext. "& extension
    oUser.SetPassword login
    oUser.SetInfo
    oUser.AccountDisabled = False
    oUser.SetInfo
	

    If Err.Number <> 0 And Err.Number <> -2147019886 Then
        x.cells(r, 15).value = err.number & ":  " & "ID creation error"
    Else

    x.cells(r, 15).value = "created"
        end if


    r = r + 1
    

    set objOU = Nothing
    set oUser = Nothing    
    set o = nothing
Err.Clear
Loop


set x = nothing

msgbox "done"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Thank you markmac! That looks like a great script. I was wondering if after setting up the users wiht this script, I right click and choose create mailbox, will it take the information in the email field and use that as their email address (each user has a different email domain) or is there a way to make a field for that? Also, will they all have the same password (login) or is there a way to set each individual password as well?

Thank you again!


[flip]
 
As this is a bulk creating script, yes all PW would be the same. You could of course modify the script to read a second column with a desired password.

Yes, you should be able to right click to make the mailboxes after doing this.

THe default email address will be whatever your Exchange Recipient Policy defines.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top