Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!
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.
$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"
Join the community of 500,000 technology professionals and ask your questions.