andrewjamesb
Technical User
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
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