設定或停用 Exchange Online 中的階層式通訊錄
階層式通訊錄 (HAB) 可讓使用者使用組織階層,在其通訊錄中尋找收件者。 如需詳細資訊,請參閱 階層式通訊錄。
下表中已描述您用來設定 HAB 的 Cmdlet 與參數:
指令程式 | 參數 | 描述 |
---|---|---|
Set-OrganizationConfig | HierarchicalAddressBookRoot | 啟用或停用組織的中的 HAB。 有效值為通訊群組或具備郵件功能的安全性群組。 您無法使用動態通訊群組或 Office 35 群組。 |
Set-Group | IsHierarchicalGroup | 指定 HAB 階層中是使用通訊群組,還是具備郵件功能的安全性群組。 有效值為 $true 或 $false (預設值為 $false )。 |
Set-Contact Set-Group Set-User |
SeniorityIndex PhoneticDisplayName |
SeniorityIndex:HAB 中對使用者、連絡人或群組,以遞減方式排序的數值 (較高值顯示於較低值前)。 PhoneticDisplayName:當多名使用者、連絡人或群組具有相同的 SeniorityIndex 值或未設定值時,使用者、連絡人或群組將以字母遞增順序列出。 如果未設定 PhoneticDisplayName,使用者、連絡人或群組將根據 DisplayName 參數值以字母遞增順序列出 (這也是沒有 HAB 的預設排序順序)。 |
開始之前有哪些須知?
預估完成時間:30 分鐘。
您必須已獲指派權限,才能執行此程序或這些程序。 To see what permissions you need, see the "Distribution groups" entry in the Feature permissions in Exchange Online topic.
若要連線至 Exchange Online PowerShell,請參閱連線至 Exchange Online PowerShell。
本主題會使用 Exchange Online PowerShell 範例來建立通訊群組,但您也可以使用 Exchange 系統管理中心 (EAC) 來建立及新增至通訊群組的成員。 若要詳細資料,請查閱建立及管理通訊群組。
建立 HAB 之後,您可以使用 EAC 來管理組織階層內的群組成員資格。 不過,您可以只使用 Exchange Online PowerShell 來設定您建立的任何新群組或使用者的SeniorityIndex參數。
提示
有問題嗎? 在 Exchange 論壇中尋求協助。 請造訪論壇:Exchange Online 或 Exchange Online Protection。
啟用和設定階層式通訊錄
步驟 1:建立 HAB 結構的通訊群組
此範例使用以下階層:
通訊群組命名為「Contoso,Ltd」,是階層中的最上層組織 (根組織)。
命名為企業總部、產品支援服務組織和銷售與行銷組織的通訊群組則為 Contoso,Ltd 之下的子組織 (Contoso,Ltd 群組成員)。
命名為人力資源、帳務事業群和系統管理事業群的通訊群組為企業總部之下的子組織 (企業總部群組成員)。
New-DistributionGroup -Name "Contoso,Ltd" -Alias "ContosoRoot"
New-DistributionGroup -Name "Corporate Office"
New-DistributionGroup -Name "Product Support Organization" -Alias ProductSupport
New-DistributionGroup -Name "Sales & Marketing Organization" -Alias "Sales&Marketing"
New-DistributionGroup -Name "Human Resources"
New-DistributionGroup -Name "Accounting Group" -Alias Accounting
New-DistributionGroup -Name "Administration Group" -Alias Administration
請注意:建立通訊群組時如果不使用 [別名] 參數,[名稱] 參數值會移除空格使用。
如需詳細的語法及參數資訊,請參閱 New-DistributionGroup。
步驟 2:使用 Exchange Online PowerShell 來指定 HAB 的根組織
此範例中將上一個步驟中命名為「Contoso,Ltd」的通訊組織指定為 HAB.的根組織。
Set-OrganizationConfig -HierarchicalAddressBookRoot "Contoso,Ltd"
步驟 3:使用 Exchange Online PowerShell 將通訊群組指定為階層式群組
下列範例會將先前建立的群組指定為階層式群組:
Set-Group -Identity "Contoso,Ltd" -IsHierarchicalGroup $true
Set-Group -Identity "Corporate Office" -IsHierarchicalGroup $true
Set-Group -Identity "Product Support Organization" -IsHierarchicalGroup $true
Set-Group -Identity "Sales & Marketing Organization" -IsHierarchicalGroup $true
Set-Group -Identity "Human Resources" -IsHierarchicalGroup $true
Set-Group -Identity "Accounting Group" -IsHierarchicalGroup $true
Set-Group -Identity "Administration Group" -IsHierarchicalGroup $true
如需詳細的語法及參數資訊,請參閱 Set-Group。
步驟 4:新增子群組做為階層中的適當群組成員
此範例將命名為企業總部、產品支援服務組織和銷售與行銷組織的群組新增為 Contoso,Ltd 的成員 (根組織)。
Update-DistributionGroupMember -Identity "Contoso,Ltd" -Members "Corporate Office","Product Support Organization","Sales & Marketing Organization"
此範例將命名為人力資源、帳務事業群和系統管理事業群的群組新增為企業總部的成員。
Update-DistributionGroupMember -Identity "Corporate Office" -Members "Human Resources","Accounting Group","Administration Group"
如需詳細的語法及參數資訊,請參閱 Update-DistributionGroupMember。
步驟 5:新增使用者至 HAB 中適當的群組
此範例會將使用者 Amy Alberts、David Hamilton 和 Rajesh M. Patel 新增到命名為企業總部的群組,而不會影響其他現有成員。
$members=@('aalberts@contoso.com','dhamilton@contoso.com','rmpatel@contoso.com')
foreach($member in $members){
Add-DistributionGroupMember -Identity "Corporate Office" -Member $member
}
如需詳細的語法及參數資訊,請參閱 Update-DistributionGroupMember。
步驟 6:使用 Exchange Online PowerShell 來設定 HAB 中群組的排序順序
群組的 SeniorityIndex 參數值會影響群組如何在 HAB 的排序方式 (先顯示較高值)。
下列範例會設定企業總部群組的子群組按照以下順序顯示:
人力資源
帳務事業群
系統管理事業群
Set-Group -Identity "Human Resources" -SeniorityIndex 100
Set-Group -Identity "Accounting Group" -SeniorityIndex 50
Set-Group -Identity "Administration Group" -SeniorityIndex 25
如需詳細的語法及參數資訊,請參閱 Set-Group。
步驟 7:使用 Exchange Online PowerShell 來設定 HAB 中使用者的排序順序
使用者的 SeniorityIndex 參數值影響使用者如何在 HAB 群組的排序方式 (先顯示較高值)。
下列範例會設定企業總部群組的成員按以下順序顯示:
David Hamilton
Rajesh M. Patel
Amy Alberts
Set-User -Identity DHamilton -SeniorityIndex 100
Set-User -Identity RMPatel -SeniorityIndex 50
Set-User -Identity AAlberts -SeniorityIndex 25
如需詳細的語法及參數資訊,請參閱 Set-User。
如何知道這是否正常運作?
若要確認您已成功啟用並設定階層式通訊錄,請使用以下步驟:
開啟已經連線至 Exchange Online 組織中信箱的設定檔 Outlook,按一下 [通訊錄],或按 Ctrl+Shift+B。 HAB 會顯示在 [組織] 索引標籤上,類似下圖。
在 Exchange Online PowerShell 中,執行下列命令來確認屬性值:
Get-OrganizationConfig | Format-List HierarchicalAddressBookRoot
Get-Group -ResultSize unlimited | where {$_.IsHierarchicalGroup -match 'True'} | Format-Table SeniorityIndex,PhoneticDisplayName,DisplayName -Auto
Get-Group -ResultSize unlimited | Format-Table SeniorityIndex,PhoneticDisplayName,DisplayName -Auto
使用 Exchange Online PowerShell 來停用階層式通訊錄
若要停用 HAB,您不需要刪除群組相關聯的 HAB 結構或重設群組或使用者的 SeniorityIndex值。 停用 HAB 只能防止 HAB 在 Outlook 中顯示。 若要以相同的組態設定再次啟用 HAB,您只需要指定 HAB 的根組織。
此範例會停用階層式通訊錄。
Set-OrganizationConfig -HierarchicalAddressBookRoot $null
如何知道這是否正常運作?
若要確認您已成功啟停用階層式通訊錄,請使用以下步驟:
開啟已經連線至 Exchange Online 組織中信箱的設定檔 Outlook,按一下 [通訊錄],或按 Ctrl+Shift+B。 確認在通訊錄中的項目依字母順序顯示。
在 Exchange Online PowerShell,執行以下命令以確認HierarchicalAddressBookRoot是空白的屬性值:
Get-OrganizationConfig | Format-List HierarchicalAddressBookRoot