Script to switch mailboxes


I am currently switching the mailboxes manually. I find the users in the MMEX console, right click and switch. This works for small migration batches but we are getting to migrating 50 mailboxes and more per day. For that the manual process is cumbersome.

Can I run the 50 users through a script that does the switch?

I took a look at the MMEX cmdlets and couldnt see anything that looked like mailbox switching.

Alternatively: If I could get the daily batch of users into 1 sync collection i can just highlight them in the console and switch. Sadly my collections are not reflecting my migration batches. Is there a way to move a list of users into 1 collection? I tried an LDAP group but that only seems to work for users who have not been in a sync collection before. The other ones just stay in their collection.

Please let me know of any ideas how i can simplify my process.

Best regards,


  • The way we handle this is to use LDAP based collections. You simply move an object from a sync collection to a switch collection and they tool will handle it. 

    A Sync collection is a collect that set to manually switch. A Switch collection is set to switch at a date/time in the past. 

    In a collection you have three options to add objects, mailboxes, DL (that will be expanded at run time)  or an LDAP filter. It is the later I am talking about. 

    For Example. My Sync collection 1 has a filter of (ExtensionAttribute12=Sync-Collection-1) and my Switch collection has a filter of (ExtensionAttribute12=Switch*)

    So all I have to do is run a powershell script to replace Sync with Switch for the objects I want to switch and the collections will do all of the work. Now it can take a little time for the object to fall out of the sync collection and into the switch collection. 

  • That sounds like what I am looking for. Does this also work if my existing sync collections have not been set up with an LDAP query? It looks like the mail enabled users were directly added to those collections.

    Also: Can you specify "a little time"? Does the agent have to come around before the mailbox is added?



  • Sorry, but no. You will have to remove them from being a static collection members before they can be a dynamic collection members. So the rule is, a mailbox can only be a member of one collection at a time. So static membership overrides dynamic membership. So you will have to remove them from the existing collections and add them to a LDAP collection. 

    If you are running the 8.15 with Update 20201118EX or later, a new feature of collection management was added to the MMEX Powershell cmdlets. See this link for details. Note: I have not used these yet, so I don't know if they offer all the collection setting. 

    there was an command line utility too, the Collection Management Utility There is a link to DL the current version on the Hofix KB. Note: These command line utilities were version AND hotfix specific. So it was a PIA to keep updates with new release or to find the older versions if needed. So your milleage may very greatly. It is referenced in this KB

Reply Children
No Data