Skip to main content

Convert Linked Mailboxes to User Mailboxes in Bulk

My organisation has gone through a massive migration project to unify Active Directories and Exchange organisations. As a result of these migrations a lot of mailbox migrations have resulted in a lot of mailboxes ending up as linked mailboxes even though their not.

The official TechNet article on this explains how to disconnect the mailbox and re-attach it to the user account correctly as a user mailbox.

Another way to make this appear to be corrected is to manually change the “Recipient Type” AD property on the affected mailboxes. This though, is unsupported.

Using the official method from Microsoft results in the loss of any specific mailbox information such as SMTP, x400 & x500 addresses, mailbox sizes and any other individual mailbox settings.

Only e-mail addresses and mailbox sizes were important to me (I must admit, I forgot about mailbox sizes at first).

I came up with the script below that would properly convert all Linked Mailboxes on a particular server to user mailboxes in a supported way. The script is very effective, but you will want to check out the list of considerations below before running it, they might lead you to amend the script slightly. You will have to modify the $exchangeserver and $userdomain variables though.

$exchangeserver = "exchccr1"
$userdomain = "domain\"

$linkedmailboxes = get-mailbox -server $exchangeserver -resultsize unlimited|where {$_.recipienttypedetails -eq "LinkedMailbox"}

foreach ($mailbox in $linkedmailboxes){
Disable-Mailbox -Identity $mailbox.displayname -confirm:$false

Get-MailboxDatabase -server $exchangeserver|Clean-MailboxDatabase

start-sleep -s 90

foreach ($mailbox in $linkedmailboxes){
$usernamestring = $userdomain + $mailbox.samaccountname
Connect-Mailbox -Identity $mailbox.exchangeguid -Database $mailbox.database -User $usernamestring
set-mailbox -identity $mailbox.displayname -emailaddresses $mailbox.emailaddresses

start-sleep -s 90

foreach ($mailbox in $linkedmailboxes){
set-mailbox -identity $mailbox.displayname -EmailAddressPolicyEnabled $mailbox.EmailAddressPolicyEnabled -emailaddresses $mailbox.emailaddresses -UseDatabaseQuotaDefaults $mailbox.UseDatabaseQuotaDefaults -ProhibitSendQuota $mailbox.ProhibitSendQuota -ProhibitSendReceiveQuota $mailbox.ProhibitSendReceiveQuota -IssueWarningQuota $mailbox.IssueWarningQuota

Some things to consider…

  • The filter on this script doesn’t consider legitimate linked mailboxes.
  • Only E-Mail addresses and mailbox sizes are re-applied to the freshly attached mailbox. More can be added to the script though.
  • You can’t attach a mailbox to a disabled account. The script won’t stop, but will error on disabled user accounts.
  • Don’t stop the script as it’s running, even if it’s choosing the wrong selection of accounts. It will mean more manual work after if you do.
  • Ensure you have "Exchange Server Administrator" permissions on the server you wish to run this script.
  • Ensure you have permissions to run the Clean-MailboxDatabase permissions on the server you wish to run this script (You don't get this by default with "Exchange Sever Administrator" permissions). If you're an admin in my 0rg, we can give you this permission if you if you don't have it already.

There you go, a script that will do all your linked mailboxes in one go. I’ve not been able to find another online, so I hope this helps you.


FredBear said…
Thanks David.

With this script, I assume it is a Powershell script that will need to be run from the Exchange Management shell?
David Owen said…
Yes, this is a PowerShell script, be careful how you use it though, as you could end up with disconnected mailboxes that will loose their configuration when re-connected.


Anonymous said…
Hi David,

Is possible to do this bulk process in the other way?. Move normal mailbox to linked mailbox?. Is possible to do with a csv file(to do this works for example dom 10 to 10 users)
Unknown said…

I am a newbie in powershell scripting and I see that get-mailbox returns information like Microsoft.Exchange.Data.MultiValuedProperty`1[System.String] : how can I get the correct information from get-mailbox (see languages for instance) how can i get the correct informations to set after with the command set-mailbox
Frank Carius said…
There is a much mor easier way with Exchange 2010 SP1

set-user -LinkedMasterAccount $null

And all the configuration is maintained
Janies said…

you mentioned that with Exchange 2010 SP1.. the "set-user -LinkedMasterAccount $null" command is much easier..

does this mean running this command will scan and convert ALL Linked Mailboxes and change them t o Regular Mailboxes?

Dennis said…
Thanks Frank, that command worked a treat. As soon as the the LinkedMasterAccount attribute was cleared, the IsLinked attribute is set to false.

Thus, the mailbox was converted from Linked to User.


If you want to convert all linked mailboxes with one PS command it would be:
Get-Mailbox -RecipientTypeDetails LinkedMailbox | Set-User -LinkedMasterAccount $null
Unknown said…
I know this is an old article but just wanted to say thanks for this script saved me a stack load of time on our Exchange 2007 to Office 365 migration. Only part we couldn't figure out how to do was delegate permissions but so few of our users use that feature we just got them to add them back in manually
zuan said…
I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
Google ads services
Google Ads Management agency
mobile application development course | mobile app development training
web designing classes in chennai | web designing training institute in chennai
web designing classes in chennai | Web Designing courses in Chennai
w3webschool said…
You are providing a post is very useful for develop my knowledge and I learn more info from your blog.
Digital Marketing Course In Kolkata
Web Design Course In Kolkata
SEO Course In Kolkata
divya said…
Excellent Blog!!! The blog which you have shared here is more informative, This is really too useful and have more ideas and keep sharing many techniques about java share more details.
Ai & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
subha said…
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well. keep it up
Ai & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
Banumadhu said…
Excellent blog thanks for sharing the valuable becomes easy to read and easily understand the information.
Useful article which was very helpful. also interesting and contains good information.
to know about python training course , use the below link.

Python Training in chennai

Python Course in chennai
Aishwariya said…
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
AWS certification course in Chennai
hektorhamelton said…
I completely resolved my question when I read this post, thanks to the author for the very detailed description. I wrote my review on the resume writing service reviews, you can go in and read. Thank you very much for your attention in your time.
Aishwariya said…
Looking a more unique post from your article.Great Article, very useful information, thank you !!
Reactjs Training in Chennai |
Best Reactjs Training Institute in Chennai |
Reactjs course in Chennai
senthilpraveen said…
The content of this blog is essential to learning stage people. Thanks for sharing.
RPA Training in Chennai
RPA Training Online
RPA Training In Bangalore

Popular posts from this blog

Upgrading Exchange 2007 Clusters to SP2 – Workaround

I posted last month about a problem delegating installs of Exchange 2007 SP2. Delegated Admins will receive an error message stating the following… You must be a member of the 'Exchange Organization Administrators' or 'Enterprise Administrators' group to continue. Have been looking into the issue and have had a case open with Microsoft. Turns out that you only get this issue on a fully patched server. If you try upgrading or installing as a delegated admin on a fresh install of either server 2008 or 2003 you don’t see the problem either with Exchange SP1 or SP2. I haven’t had time to identify exactly what patch causes this yet, if I’ll bother at all. If you have patched your server though, MS came up with this workaround. Disable update checking for the BPA by heading into the registry and HKCU\Software\Microsoft\Exchange\ExBPA and either creating or modifying a DWORD named “VersionCheckAlways” and set it to ‘0’ Copy the installation files to a local drive and replace S

Creating a Windows PE 3 Bootable USB device

I’ve used Windows PE for a long time. And I’ve grown to love it. It’s an extremely useful tool, not just for OS installation, but for diagnostics. Since there’s a version of WinPe for x64 & x86 (& itanium) I like to keep both x64 & x86 on my USB stick. Essentially copying the each version to the root of the USB stick as needed. Meaning at any one time I have three copies of WinPE on my USB stick. Other applications I copy directly to my USB stick, so that I don’t have to remount the image every time i need another application added. Shortly after Windows 7 was released came a new version of WinPE, WinPE 3.0 on the Windows Automated Installation Kit. Preparing the USB stick. You’ll need to prepare the USB stick. To do this open a command prompt using Run As Administrator and use the following commands. diskpart list disk select disk 7 clean create partition primary select partition 1 active format quick fs=fat32 assi