大量匯入外部聯絡人至 Exchange Online
【參考資訊】
Bulk-create external contacts in Exchange Online
http://community.office365.com/en-us/w/exchange/579.aspx
The Will Will Web Office 365 管理系列:使用 PowerShell 管理微軟線上服務
使用遠端 PowerShell 連線到 Exchange Online Exchange Online Help
http://technet.microsoft.com/zh-tw/library/jj984289.aspx
1. Download Sample CSV then input the columns
http://community.office365.com/en-us/f/183/t/10030.aspx
2. 安裝Microsoft Online Services 登入小幫手 RTW
http://www.microsoft.com/zh-tw/download/details.aspx?id=28177
http://go.microsoft.com/fwlink/p/?linkid=236297&clcid=0xC04
3. 安裝Windows Azure AD Module for Windows PowerShell
http://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule
4. 執行 【適用於 Windows PowerShell 的 Windows Azure Active Directory 模組】
輸入以下指令
$UserCredential = Get-Credential
連線
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Import-Module MSOnline
新增外部連絡人
Import-Csv C:\Users\9203901\Desktop\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}
更新外部聯絡人資訊
$Contacts = Import-CSV C:\Users\9203901\Desktop\externalcontacts.csv
$contacts | ForEach {Set-Contact $_.Name -StreetAddress $_.StreetAddress -City $_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode -Phone $_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone -Company $_.Company -Title $_.Title -OtherTelephone $_.OtherTelephone -Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office $_.Office -Manager $_.Manager}
完成後離開 session
Remove-PSSession $Session
Connect-MsolService
Get-msolcontact 是可以看到已存在的外部聯絡人