I created a new version of this script here
I recently completed a project that involved migrating Exchange 2010 Mailbox role from a standalone server to a Database Availability Group, or DAG. This was a large project that took a lot of time and planning, and had the potential to be very tedious. Fortunately, with a little knowhow, you can automate many of the tedious tasks.
I wanted to be in full control of mailbox migration, so my requirements were fairly strict: