search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
How to fix incorrect msExchHomeServerName attribute after removing an Exchange Mailbox?
Posted in Windows Powershell | 4 Comments | 23,107 views | 27/03/2013 11:03

When you remove an Exchange Mailbox from DAG or your environment, msExchHomeServerName attribute remains same. You may get problem when you try to update user mailbox due to non exist Mailbox Server. In order to achieve this problem, you should get affected mailboxes first, then you should update them with correct mailbox server name.

First get all affected mailboxes:

$Mailboxes = Get-Mailbox -ResultSize Unlimited | where {$_.Servername -eq "Old_Mailbox_Name"}

Update them with this:

1
2
3
4
5
6
7
foreach ($Mailbox in $Mailboxes)
{
Write-Host $Mailbox.Name
$MBX = $null;
$MBX = Get-Mailbox -Identity $Mailbox
Set-Mailbox $MBX -Database $MBX.Database -Confirm:$false -Force -Verbose
}

After that process, all msExchHomeServerName will be corrected.


Comments (4)

Chris

July 2nd, 2014
19:25:36

I have been looking every for this! Thank you. You have saved the day!


homeMTA points to Active Directory object that have been deleted | Me tech notes

February 27th, 2015
12:11:05

[…] Source: http://www.yusufozturk.info/windows-powershell/how-to-fix-incorrect-msexchhomeservername-attribute-a… […]


Event 2937 https metechnotes wordpress com 2015 02… | IT Management

May 18th, 2015
04:37:11

[…] http://www.yusufozturk.info/windows-powershell/how-to-fix-incorrect-msexchhomeservername-attribute-a… […]


John Mohler

February 4th, 2020
01:35:43

Why, when you run it, does it go through every address book in the organization? I have only run small one user tests but worry that running against 30,000+ accounts will take forever. If that is something that can be omitted for speed, can you let me know?



Leave a Reply