none
Mailbox creation Automation RRS feed

  • Question

  • Guys, 
    For my test environment I created a new OU and populated it with 200 users using the CSVDE but now all are user account are in "disabled state " 
    So i want all the user to be enabled.
    Creation of mailboxes for all the AD users accounts through script / Tool/ Cmdlet (EMS) . 
    Please help.
    Wednesday, September 21, 2011 12:05 PM

Answers

  • amit,

    Your question has nothing to do with a mailbox, it's an AD account question. modify the script below to what you need. Also, check out the tool i wrote to automate ad/exchange/lync accounts.

    ________________________

    Set objRootDSE = GetObject("LDAP://rootDSE")
    Set objContainer = GetObject("LDAP://cn=Users," & _
        objRootDSE.Get("defaultNamingContext"))
     
    For i = 2001 To 3000
        Set objLeaf = objContainer.Create("User", "cn=Site02CoolGuy" & i)
        objLeaf.Put "sAMAccountName", "Site02CoolGuy" & i

    objLeaf.Put "description", "I am the Site02CoolGuy" & i
    objLeaf.Put "displayname", "zzSite02CoolGuy" & i
    objLeaf.Put "givenname", "Site02"
    objLeaf.Put "sn", "CoolGuy" & i
    objLeaf.Put "telephonenumber", "408555" & i
    objLeaf.Put "wwwhomepage", "www.Site02CoolGuy" & i & ".com"
    objLeaf.Put "physicaldeliveryofficename", "London" & i

             objLeaf.Put "userPrincipalName", "Site02CoolGuy" & i & "@zenqa.net"
        objLeaf.SetInfo
    Objleaf.setpassword "labpassword" & i
    Objleaf.accountdisabled = False
    Objleaf.setinfo
    Next
     
    WScript.Echo "1000 Users created."

     


    Z-Hire -- Automate IT Account creation process ( AD / Exchange / Lync )
    Z-Term -- Automate IT account termination process ( AD / Exchange )
    • Proposed as answer by Sophia Xu Friday, September 23, 2011 8:42 AM
    • Marked as answer by Sophia Xu Thursday, October 6, 2011 7:41 AM
    Wednesday, September 21, 2011 4:02 PM

All replies

  • Hello,

    Get-User -OrganizationalUnit OU | Enable-Mailbox -Database DB_NAME

    Greetings,

    Toni

    Wednesday, September 21, 2011 12:56 PM
  • amit,

    Your question has nothing to do with a mailbox, it's an AD account question. modify the script below to what you need. Also, check out the tool i wrote to automate ad/exchange/lync accounts.

    ________________________

    Set objRootDSE = GetObject("LDAP://rootDSE")
    Set objContainer = GetObject("LDAP://cn=Users," & _
        objRootDSE.Get("defaultNamingContext"))
     
    For i = 2001 To 3000
        Set objLeaf = objContainer.Create("User", "cn=Site02CoolGuy" & i)
        objLeaf.Put "sAMAccountName", "Site02CoolGuy" & i

    objLeaf.Put "description", "I am the Site02CoolGuy" & i
    objLeaf.Put "displayname", "zzSite02CoolGuy" & i
    objLeaf.Put "givenname", "Site02"
    objLeaf.Put "sn", "CoolGuy" & i
    objLeaf.Put "telephonenumber", "408555" & i
    objLeaf.Put "wwwhomepage", "www.Site02CoolGuy" & i & ".com"
    objLeaf.Put "physicaldeliveryofficename", "London" & i

             objLeaf.Put "userPrincipalName", "Site02CoolGuy" & i & "@zenqa.net"
        objLeaf.SetInfo
    Objleaf.setpassword "labpassword" & i
    Objleaf.accountdisabled = False
    Objleaf.setinfo
    Next
     
    WScript.Echo "1000 Users created."

     


    Z-Hire -- Automate IT Account creation process ( AD / Exchange / Lync )
    Z-Term -- Automate IT account termination process ( AD / Exchange )
    • Proposed as answer by Sophia Xu Friday, September 23, 2011 8:42 AM
    • Marked as answer by Sophia Xu Thursday, October 6, 2011 7:41 AM
    Wednesday, September 21, 2011 4:02 PM
  • Guys please give me some time i will check and update you all mean while if anybody is having more options then please...update. Thanks ..   
    Friday, September 23, 2011 5:45 AM
  • If you are interested in 3rd party solutions, you can have a look at Adaxes.

    It allows you to automatically create and configure mailboxes in Exchange.

    Demo Video - Exchange Management and Automation

    Tuesday, April 2, 2013 11:49 AM