Office365與本地Exchange互遷移用戶及錯誤提示解決方案shell
咱們前面的文章有介紹Office365與本地Exchange2013 CU9的混合部署,混合部署後,咱們須要測試一下如何將本地的Exchange郵箱用戶遷移到Office365 online上,及將Office365 Online上的用戶遷移到本地的Exchange上。具體操做咱們就開始了。咱們在這次的操做中遇到點錯誤,最終節後後,將解決方案一併分享給有須要的童鞋,具體見下:數據庫
如下鏈接是微軟官網提供的一些解決方案,但願對有須要的童鞋幫助。windows
https://technet.microsoft.com/zh-CN/library/jj150487(v=exchg.150).aspxbash
https://technet.microsoft.com/en-us/library/jj906432%28v=exchg.150%29.aspx服務器
咱們經過本地服務器登錄EMC後,單擊切換到office364後---遷移ide
咱們能夠看見有兩個遷移選項,一個就是將本地Exchange郵箱用戶遷移到Office365 Online上,另一個就是將Office 365郵箱用戶遷移到本地的Exchange服務器上。測試
咱們測試將本地的Exchange郵箱用戶遷移到Office365 Online上;咱們單擊選擇須要遷移的用戶ui
咱們選擇user02this
輸入Exchange服務器的全局管理員(organzition server)組用戶,在此咱們使用administrator進行驗證spa
咱們選擇遠程的MRS代理服務器:
MRS代理服務器爲在外部能夠訪問Exchange服務器內部服務器的代理服務,該服務咱們能夠理解爲CAS服務器的對方訪問地址。經過該服務地址咱們能夠在外部訪問本地的Exchane郵箱用戶及收發郵件。
而後定義一個遷移名稱,在此咱們定義爲:migration to office365
定義遷移後的服務通知報告,在此咱們選擇gaowenlong、user01郵箱用戶。在此能夠選擇任意用戶
開始遷移,提示正在同步
提示正在同步一個用戶
遷移數據已同步完成—遷移完成
遷移後,咱們登陸到gaowenlong、user01郵箱下,能夠看見系統發送的一封遷移報告
同步完成後,咱們須要對同步用戶進行批處理遷移配置
遷移用戶操做已經完成。
接下來咱們登陸office365郵箱管理中心,查看遷移的用戶狀態,發現剛纔遷移的用戶沒有顯示
遷移到office365上的用戶,若是須要登陸郵箱的話,咱們須要對office365上的用戶分配許可
選定用戶---編輯---分配許可
咱們經過本地的Exchange訪問服務進行登陸剛纔遷移的用戶,會提示須要訪問如下連接才能夠登陸用戶郵箱。
咱們單擊跳轉指定連接後,user02能夠正常登陸user02的郵箱服務
咱們測試使用本地的user01給office365上的user02發送測試郵件
使用office365上的user02用戶回覆本地的user01用戶
接下來咱們測試將office365上的帳戶遷移到本地
咱們首先在office365上建立一個郵箱用戶
建立一個office365用戶user03
用戶建立完成
建立後,咱們須要使用dirsync同步到office365上
Start-onlinecoexistencesync
執行強制同步後,咱們登陸office365管理中心,能夠看見剛纔建立的office365用戶user03
咱們準備將office365上的用戶user03遷移到本地
遷移----從exchange onlie遷移
咱們選擇user03
一樣選擇遠程MRS代理服務器
咱們再次給本地服務器添加了一個數據庫;
在遷移本地以前確認數據庫的名稱;再次建議你們在作本地遷移的時候,數據庫名稱不建議有空格,若是有空格那樣遷移的話會有問題,提示找不到用戶的數據庫guid,爲了保險起見,建議修改默認數據庫名稱或者添加新的數據庫
查看當前服務器的數據庫服務
接下來定義定義遷移處理名稱----migration to local
定義遷移屬性,在此建議自動啓動批處理程序
咱們發現用戶遷移失敗
咱們根據錯誤搜索解決方案
https://support.microsoft.com/en-us/kb/2956029
CAUSE
This behavior occurs because the value of the mailbox GUID isn't stamped on the associated mailbox in the on-premises organization.
Note The mailbox value is stored in the ExchangeGUID property (also known as the msExchMailboxGUID attribute).
This situation occurs because the value of the property isn't synced to the associated remote mailbox in the on-premises organization when a mailbox is created in Exchange Online.
To move a mailbox, the value of the ExchangeGUID property must be the same in the Exchange Online mailbox and in the associated on-premises remote mailbox.
SOULTION
Set the ExchangeGUID property on the associated on-premises remote mailbox before you move the mailbox to the on-premises organization. To do this, follow these steps:
1.Open the Exchange Management Shell on the on-premises server, and then run the following command to check whether the ExchangeGUID property of the on-premises remote mailbox is set:
Get-RemoteMailbox <alias of cloud mailbox to move> | Format-List ExchangeGUID Note If the ExchangeGUID property returns all zeros, the value isn't stamped on the on-premises remote mailbox. get-remotemailbox user03 | format-list exchangeGuid
Note If the ExchangeGUID property returns all zeros, the value isn't stamped on the on-premises remote mailbox.
2.Open Windows PowerShell (don't use the Exchange Management Shell), and then connect to Exchange Online. For more info about how to do this, see Connect to Exchange Online Using Remote PowerShell.
使用如下連接進行操做
https://technet.microsoft.com/library/jj984289(v=exchg.160).aspx
使用windows powershell 連接到exchange online
開始以前咱們須要準備
您可使用 Windows 的如下版本:
Windows 10
Windows 8 或 Windows 8.1
Windows Server 2012 或 Windows Server 2012 R2
Windows 7 Service Pack 1 (SP1)*
Windows Server 2008 R2 SP1*
* 您須要安裝 Microsoft.NET Framework 4.5 或更高版本,而後安裝 Windows Management Framework 3.0 或 Windows Management Framework 4.0。有關詳細信息,請參閱安裝 .NET Framework 和 Windows Management Framework 3.0 或 Windows Management Framework 4.0。
2.1打開本地的級算計上的windows powershell,運行如下命令
set-executionpolicy remotesigned 容許簽名
$UserCredential = Get-Credential
在「Windows PowerShell 憑據請求」對話框中,鍵入您的 Office 365 用戶名和密碼,而後單擊「肯定」
2.2
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection 若是您是由世紀互聯運營的中國 Office 365 客戶,請爲 ConnectionUri 參數使用如下值:https://partner.outlook.cn/PowerShell.
由於咱們環境是世紀互聯的
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
2.3
Import-PSSession $Session
2.4
最後操做完成後,咱們可使用如下命令完成斷開與遠程的powershell 會話連接
Remove-PSSession $Session
2.5
確認是否連接成功
get-mailbox
3.Run the following command to retrieve the value of ExchangeGUID property of the mailbox that you want to move.
Get-Mailbox <MailboxName> | Format-List ExchangeGUID
4.Run the following command to set the value of the ExchangeGUID property on the on-premises remote mailbox to the value that you retrieved in step 3:
Set-RemoteMailbox <MailboxName> -ExchangeGUID <GUID>
get-remotemailbox user03 -exchangeguid 6axxxxxxxx
5.Force directory synchronization. For more info about how to do this, see the "Force directory synchronization" section of Synchronize your directories.
而後咱們嘗試再次遷移
咱們把原來的錯誤的遷移信息刪除
提示已經同步完成
同步完成後,正在處理批處理程序
用戶遷移成功
office365上的用戶列表中已沒有user03了
咱們查看user03已成爲本地用戶
最後咱們經過本地的服務器訪問地址進行登陸user03
登陸成功
咱們使用user03給user01發送測試郵件
再使用user01的本地郵箱給user03發送測試郵件
最後咱們總結一下,其實遷移用戶後,用戶屬性會發送變化
若是從本地遷移到office365 onlie上的話 ,會在用戶屬性多一個targetaddress配置屬性
用戶關聯後,咱們通常使用的是從office365到本地的用戶之間私用的是proxyaddress