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
May 22nd, 2012 2:16pm

What creates that csv file in the first place? Is the selection criteria within AD already? You could easily run $userlist = Get-User <some filter criteria> $userlist | Enable-Mailbox $userlist | Set-Mailbox -ManagedFolderMailboxPolicy 'Mailbox retention 180 days' -ManagedFolderMailboxPolicyAllowed Mike Crowley | MVP My Blog -- Planet Technologies
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2012 7:59pm

What creates that csv file in the first place? Is the selection criteria within AD already? You could easily run $userlist = Get-User <some filter criteria> $userlist | Enable-Mailbox $userlist | Set-Mailbox -ManagedFolderMailboxPolicy 'Mailbox retention 180 days' -ManagedFolderMailboxPolicyAllowed Mike Crowley | MVP My Blog -- Planet Technologies
May 22nd, 2012 8:05pm

Hi Andrew, Any updates?Frank Wang TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
May 23rd, 2012 11:15pm

Hi Mike Thank you for the reply. I manually populate the CSV file with user IDs that need email accounts. Please could you show me a way to combine all three scripts into one script rather than run them seperately? The relevant Exchange admin tools are installed. The first script creating mailboxes above works but I get an error coming back 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" Thanks Andy
May 24th, 2012 4:56am

Yes, I can help combine the code, but you must first tell me what the selection criteria would be. You're saying you enter 1000 accounts manually into a csv. That sounds like a horrible afternoon. :) enable-mailbox requires an identity parameter. This can be passed through the pipeline, but it depend on what your csv looks like, or better yet, what we grab using criteria I asked about above. Mike Crowley | MVP My Blog -- Planet Technologies
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2012 12:59pm

Hi Mike No worries I found a solution :-) Thanks for your help nevertheless Andy
May 29th, 2012 6:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics