Share via


Convert mailbox to a mail user.

Question

Saturday, September 10, 2011 10:27 PM

Hello,

I've seen examples on how to script the other way around.  Does anyone know how to change a mailbox user into a mail enabled user and also apply all of the x500, email addresses, and legacy DN of the old mailbox on to the mail user (via powershell or other means)?

 

Thanks

All replies (6)

Saturday, September 10, 2011 10:42 PM ✅Answered

Here's a script written by Mike Crowley (MVP) that is very useful. Have used it myself.

Converting a Mailbox to a MailUser (and not losing attributes)
http://mikecrowley.wordpress.com/2010/12/09/converting-a-mailbox-to-a-mailuser-and-not-loosing-attributes/

MCTS: Messaging | MCSE: S+M


Sunday, September 11, 2011 12:13 AM ✅Answered | 1 vote

Yes, remote mailbox moves/cross forest moves will do this. What is the end result you're trying to achieve?

As for a script, if Mike's doesn't do what you want, something like this might (untested! may contain syntax errors, but at least might point you in the right direction)

# get mailbox attributes
$Mailbox = Get-Mailbox username
#disable mailbox
Disable-Mailbox username
# enable as mailuser
Enable-Mailuser username
#Set properties including adding legacyExchangeDN as an X500 address
$EmailAddresses = $Mailbox.EmailAddresses
$EmailAddresses += "x500:$($Mailbox.LegacyExchangeDN)"
Set-MailUser username -PrimarySmtpAddress $Mailbox.PrimarySmtpAddress -EmailAddresses $EmailAddresses -ExternalEmailAddress [email protected]

Hope this helps

Steve

Steve Goodman
Check out my Blog for more Exchange info or find me on Twitter


Saturday, September 10, 2011 11:32 PM

This looks promissing, but I don't really need the attributes 1-15.  The most important part would be keeping the old email addreses.  Especially if you are not using alias@domain on the source (although this is fine for the target/external email).  Also, the legacy DN will change for users created in previous versions of exchange.  This will cause problems for outlook users trying to email them once converted. 

Ideally the script would do this:

1. capture all email addresses/proxy addresses

2. capture the legacy dn (I think this would need to read it from the AD user object, not the mailbox?)

3. Mail disable the user (disconnect mailbox)

4. mail enable the user (as a recipient type Mail User)

5. copy back all of the captured orginal mailbox properties

 

I guess I can tinker with this if there's nothing already available.  The cross forest move request probably does all of this behind the scenes.

 

 


Monday, September 12, 2011 1:54 PM

Thanks for this!  I will test it out.

 

What we are trying to achieve:  We purchased a product called quest migration manager to sync accounts and mailboxes crossforest.  Unfortunately it was never explained to us that the "Old" mailbox is left in place by this tool.  This breaks outlook during the coexistence phase because outlook is still getting it's autodiscover information from the old organization (via the SCP or autodiscover url).  The professional services that were required for the tool install were baffled about this new fangled "autodiscover" that's been mainstream since 2007.  The only way to get autodiscover to work properly is to delete the old mailbox and setup a mail enabled user with a target address that points to the new server (which enables forwarding of autodiscover requests).


Monday, September 12, 2011 6:59 PM

Another option would be to deploy a static Autodiscover.xml file. In combination with a registry entry you can force the static XML to be preferred over any other Autodiscover method. To make it fool-proof, you need several registry entries.

I have explained the steps in detail in this thread, which for reasons unbeknownst to me was not considered as an answer. This technique was used while migrating Norway's largest bank, later on another major multinational customer. Currently I operate an Exchange 2010 environment, where we use this method as well.

While I have not studied the details of how Office 365 handles that two forests share the same SMTP address, I believe the method is very similar from what I've seen here in the forums. You do also find a description of the basic procedure in chapter 4 of Exchange Server 2010 Best Practices.

Accessing mailbox from another domain - Autodiscover issue
http://social.technet.microsoft.com/Forums/da-DK/exchangesvrgeneral/thread/e7890184-56fe-450f-a7b7-6337707d559e

MCTS: Messaging | MCSE: S+M


Monday, September 12, 2011 9:06 PM

Hi Jon

We also considered this as an option, but for our environment it seemed like more of a hassle than just disconnecting the old mailbox and creating the mail user.  We have a lot of non outlook clients that use autodiscover (MAC, active sync phones) as well.  Also, it's nice that the user can't log in to their old mailbox by mistake.   I can see why you would use the xml method in a large corporate migration, though.

Thanks

http://blogs.technet.com/b/mhass/archive/2010/06/16/autodiscover-using-targetaddress.aspx