Thursday, February 16, 2012

Exchange 2010 enable mailbox for users in an OU


Use this command to generate mailboxes for all user accounts in a specified organizational unit:


Open Exchange Management Shell with Administrator rights, then:


Get-User -OrganizationalUnit <OU_NAME> | where-object {$_.RecipientType -eq "User"} | Enable-Mailbox -Database "<DATABASE_NAME>" | get-mailbox | select name,windowsemailaddress,database


Example:

Get-User -OrganizationalUnit Baibr2010 | where-object {$_.RecipientType -eq "User"} | Enable-Mailbox -Database "Student Mailbox Store" | get-mailbox | select name,windowsemailaddress,database

-> This will create mailboxes for all users in an OU named Baibr2010, and in the mailbox database Student Mailbox Store and domain ibs-t.hu

Output sample:

Name                                    WindowsEmailAddress                     Database
----                                    -------------------                     --------
Stiller David                           DSTILLER@ibs-t.hu                       Student Mailbox Store
Bayarsaikhan Oyunjargal                 OBAYARSAIKH@ibs-t.hu                    Student Mailbox Store
Puiu Roman                              RPUIU@ibs-t.hu                          Student Mailbox Store
Lajos Adrian                            ALAJOS@ibs-t.hu                         Student Mailbox Store
Raab Renata Rozsa                       RRAAB@ibs-t.hu                          Student Mailbox Store
Lang Lorand                             LOLANG@ibs-t.hu                         Student Mailbox Store
Lazar Zsolt                             ZSLAZAR@ibs-t.hu                        Student Mailbox Store
Li Cong                                 CLI@ibs-t.hu                            Student Mailbox Store
Tran Ba Duy Phuong                      BTRAN@ibs-t.hu                          Student Mailbox Store

No comments:

Post a Comment