大量匯入外部聯絡人至 Exchange Online

大量匯入外部聯絡人至 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 管理微軟線上服務

http://blog.miniasp.com/post/2013/01/26/Office-365-Administration-Using-PowerShell-manage-Microsoft-Online-Service.aspx

使用遠端 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

clip_image002

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 模組】

clip_image003

輸入以下指令

$UserCredential = Get-Credential

clip_image004

clip_image005

連線

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

clip_image006

Import-PSSession $Session

clip_image007

Import-Module MSOnline

clip_image008

新增外部連絡人

Import-Csv C:\Users\9203901\Desktop\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

clip_image009

更新外部聯絡人資訊

$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}

clip_image010

clip_image012

完成後離開 session

Remove-PSSession $Session

Connect-MsolService

Get-msolcontact 是可以看到已存在的外部聯絡人

clip_image013

您可能也會喜歡…

Social Media Auto Publish Powered By : XYZScripts.com