INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Management With PowerShell

How to Mass Create Mailboxes for Existing Users by markdmac
Posted: 19 Jan 08

markdmac's Managing Exchange 2007 With PowerShell Scripts

By Mark D. MacLachlan, The Spiders Parlor
http://www.thespidersparlor.com


The following PowerShell script will query AD for users and create mailboxes for them in Exchange 2007.  Just replace the servername portion in red with your Exchange server's name.  If you changed the store name from the default, edit the part in blue too.

CODE

get-user | where-object{$_.RecipientType ûeq "User"} | Enable-Mailbox ûDatabase "servername\Mailbox Database" | get-mailbox | select name,windowsemailaddress,database

If you would like to target a specific OU instead of traversing the entire AD tree, you can do so by specifying the OU name.  Note the OU name is in green below.

CODE

get-user ûorganizationalUnit Accounting | where-object{$_.RecipientType ûeq "User"} | Enable-Mailbox ûDatabase "servername\Mailbox Database" | get-mailbox | select name,windowsemailaddress,database

Back to PowerShell (Microsoft) FAQ Index
Back to PowerShell (Microsoft) Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close