I have a significant number of user mailboxes that need to be converted to linked mailboxes. I'm testing the process now with individual accounts and am having difficulty.
In my test today, it appeared that I successfully made the conversion, but the freshly linked account had an empty mailbox. Before the switch, he had 2.5 GB in his mailbox. I need to know what this failed and how to get his mail back.
I used this script:
$Arg1 = "username" #same in account and resource forests)
$username = "accountforest\admin"
$password = ConvertTo-SecureString -String "********" -AsPlainText -Force
$cred = New-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
Disable-Mailbox -Identity $Arg1
Enable-Mailbox -Identity $Arg1 -Alias $Arg1 -Database 'DB05' -LinkedMasterAccount 'accountforest.priv\username' -LinkedDomainController 'dc01.accountforest.priv' -LinkedCredential:$cred
Set-Mailbox -Id $arg1 -customAttribute1 "CompanyName"
I hobbled this together from several sources. When I ran it, I got an error about the account in the resource forest not being disabled. I disabled it in ADUC and ran the script again. This time is linked but the user had an empty mailbox. I can find no trace of the 2.5GB mailbox he was using before.
Any help is greatly appreciated.