Command to reconnect the mailboxes in bulk

I am a bit afraid to try this. I have the disbaled user list in a CSV file.
http://blogs.technet.com/b/mukutdas/archive/2014/07/21/reconnecting-mailboxes-in-a-bulk-exchange-2010.aspx
Does anyone know how to reconnect with alias all the disabled mailboxes
LVL 33
MASEE Solution Guide - Technical Dept HeadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
Test this first for a single user first but use the powershell command below...
Connect-Mailbox -Identity <alias> -Database <database name> -User <ad account>

Open in new window


When you have this down construct your CSV like below...
Mailbox          ADUser
Mike Witts           Mike Witts
...
Add multiple mailboxes via script from CSV
$DisMailBoxes = Import-csv "c:\filename.csv"
ForEach ($M in $DisMailboxes) {
$M.Mailbox
$M.ADUser
Connect-Mailbox -Identity $M.Mailbox -Database <database name> -User $M.ADUser
}

Open in new window


If you have different databases for each user you will need to add this to the CSV as a 3rd column and then changing the -Database to $M.Database (where Database is a 3rd column in the CSV).

Will.
MASEE Solution Guide - Technical Dept HeadAuthor Commented:
I have mailboxes from multiple databases to be reconnected

Please guide how to add the 3rd column

or type here how it will be when there is multiple databases
Will SzymkowskiSenior Solution ArchitectCommented:
Construct the CSV like below...

Mailbox         ADUser          Database
Mike Witts     Mike Witts     Database1
John Smith    John Smith     Database2

Original Script Modified.
$DisMailBoxes = Import-csv "c:\filename.csv"
ForEach ($M in $DisMailboxes) {
$M.Mailbox
$M.ADUser
$M.Database
Connect-Mailbox -Identity $M.Mailbox -Database $M.Database -User $M.ADUser
}

Open in new window


Will.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

MASEE Solution Guide - Technical Dept HeadAuthor Commented:
@Will
When i reconnect the users  all are having double the size of before deletion.
And showing your mailbox is full. How to fix this.

Sorry for asking a question off topic.
Will SzymkowskiSenior Solution ArchitectCommented:
Easiest and quickest way is to set your databases to unlimited quota, from the EMC, cleanup the reconnected mailboxes and then change the database quotas back to what they originally were.

Will.
MASEE Solution Guide - Technical Dept HeadAuthor Commented:
How do I cleanup ?
Will SzymkowskiSenior Solution ArchitectCommented:
How are the mailboxes double in size? Are the messages duplicated with in the mailbox?

Will.
MASEE Solution Guide - Technical Dept HeadAuthor Commented:
No. Email in the mailboxes are the same and no duplicates.
But size is almost double
Will SzymkowskiSenior Solution ArchitectCommented:
Have you checked the dumpster for each mailbox you restored? If you run get-mailboxstatistics for one of the restored mailboxes what folder is taking up the space? Then once you find the folder check file attachments etc.

I have not seen this type of behavior after restoring a disconnected mailbox.

Will.
MASEE Solution Guide - Technical Dept HeadAuthor Commented:
Many thanks Will
MASEE Solution Guide - Technical Dept HeadAuthor Commented:
Awaiting your reply on this. Quick help is highly appreciated
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_28662016.html
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.