Announcement

Collapse
No announcement yet.

Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

    Hi
    I want to create around 1000+ new exchange 2007 mailboxes for existing AD user accounts. Is there a simpler way to do this?


    Script to create mailboxes for users

    $mailbox=import-csv C:\Users\admin-me\Desktop\mail.csv
    foreach ($mailbox in $mailbox) {enable-mailbox -identity $mailbox.identity -database $mailbox.database}


    The above script seems to create the mailboxes but throws up an error due to the enable-mailbox function:


    The term 'enable-mailbox' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
    the spelling of the name, or if a path was included, verify that the path is correct and try again.


    I also need to create another script or add to above script to set a mailbox retention policy as I have tried below

    $data = import-csv C:\Users\admin-me\Desktop\180.csv
    foreach ($line in $data) {set-mailbox $line.mailboxname -managedfoldermailboxpolicy 'Mailbox retention 180 days' -managedfoldermailboxpolicyallowed -confirm:$false}


    Also need to create a script to prohibit email sending restrictions to 17MB per email, but allow users to receive emails


    Any help on merging all above scripts would be very much appreciated. Or if I have to run three seperate scripts thats fine too for same user base


    Many Thanks for reading

  • #2
    Re: Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

    In Exchange 2007 the only reason I can think of is, you are running that script on a comp which doesn't have Exchange 2007 admin tools installed.

    The script parts looks fine so far without knowing the content of your input files.

    Comment


    • #3
      Re: Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

      Hi

      Thank you for your reply. The relevant Exchange admin tools are installed. The error coming back is

      enable-mailbox: cannot bind parameter 'identity'. Cannot convert value "" to type "microsoft .exchange.configuration.tasks.useridparameter". Error: "The parameter value of this type Microsoft.exchange.configuration.tasks.useridparam eter cannot be empty
      Parameter name: identity"

      Comment


      • #4
        Re: Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

        Check your CSV file for null data
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

          Thanks for your reply, altough I have checked the CSV file and there are no white spaces

          Comment


          • #6
            Re: Creating bulk multiple ex2007 Mailbox via CSV for Existing AD Accounts

            Ok, the error you stated isn't the same as in your first post, so I would try to alter your current command line.

            At first your make "foreach ($mailbox in $mailbox)", maybe try something like foreach ($mbx in $mailbox) and alter the rest of the command line for this change.

            The other thing you can try is the form you import the data for the identity, try the UPN or the "domain\username".

            Comment

            Working...
            X