管理 Exchange Online 中的地址清單Manage address lists in Exchange Online

地址清單為您組織中的郵件功能之物件的集合。擁有郵件功能之物件所具有的電子郵件地址在組織中任何物件。每個地址清單可以包含一或多個類型的物件 (例如使用者、 連絡人、 群組、 公用資料夾及會議室及器材信箱)。通訊清單也提供一種方式給分割區可特定使用者群組的郵件功能之物件。本主題說明如何管理 Exchange Online 中的地址清單。Address lists are a collection of mail-enabled objects in your organization. Mail-enabled objects are any object in your organization that has an email address. Each address list can contain one or more types of objects (for example, users, contacts, groups, public folders, and room and equipment mailboxes). Address lists also provide a way to partition mail-enabled objects for the benefit of specific groups of users. This topic explains how to manage address lists in Exchange Online.

如需與管理通訊清單相關的其他管理工作,請參閱 地址清單 Exchange Online 中的程序For additional management tasks related to manage address lists, see Address list procedures in Exchange Online.

要尋找此主題的 Exchange 2013 版本嗎?請參閱建立通訊清單Looking for the Exchange 2013 version of this topic? See Create an Address List.

開始之前有哪些須知?What do you need to know before you begin?

  • 每項程序的預估完成時間:5 分鐘。Estimated time to complete each procedure: 5 minutes.

  • 您僅可使用命令介面執行此程序。若要了解如何使用 Windows PowerShell 連線至 Exchange Online,請參閱Connect to Exchange Online PowerShellYou can only use the Shell to perform this procedure. To learn how to use Windows PowerShell to connect to Exchange Online, see Connect to Exchange Online PowerShell.

  • 在 Exchange Online ** *-AddressList** cmldets 僅中可用的通訊清單的管理角色。預設 Exchange Online 中的地址清單角色不被指派給任何角色群組。若要使用任何需要的地址清單角色的指令程式,您需要將角色新增至角色群組。如需詳細資訊,請參閱主題、管理角色群組的 「 將角色新增至角色群組 」 一節。In Exchange Online, the *-AddressList cmldets are only available in the Address Lists management role. By default in Exchange Online, the Address List role isn't assigned to any role groups. To use any cmdlets that require the Address List role, you need to add the role to a role group. For more information, see the "Add a role to a role group" section in the topic, Manage role groups.

  • 如需適用於此主題中程序的快速鍵相關資訊,請參閱 Keyboard shortcuts in Exchange 2013For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

提示

有問題嗎?在 Exchange 論壇中尋求協助。 論壇的網址為:Exchange ServerExchange OnlineExchange Online ProtectionHaving problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server,Exchange Online, or Exchange Online Protection.

您要執行的工作What do you want to do?

建立通訊清單Create an address list

本範例會建立名為奧及華盛頓使用者使用_RecipientFilter_參數的地址清單並附上收件者的信箱使用者及已設為StateOrProvince WashingtonOregonThis example creates the address list named Oregon and Washington Users by using the RecipientFilter parameter and includes recipients that are mailbox users and have StateOrProvince set to Washington or Oregon.

New-AddressList -Name "Oregon and Washington" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington') -or (StateOrProvince -eq 'Oregon')))}

此範例會使用內建條件在 All Rooms 父系容器中建立子系通訊清單 Building 34 Meeting Rooms。This example creates the child address list Building 34 Meeting Rooms in the All Rooms parent container, using built-in conditions.

New-AddressList -Name "Building 34 Meeting Rooms" -Container "\All Rooms" -IncludedRecipients Resources -ConditionalCustomAttribute1 "Building 34"

如需詳細的語法及參數資訊,請參閱 New-AddressListFor detailed syntax and parameter information, see New-AddressList.

更新通訊清單Update an address list

Update-addresslist指令程式無法在 Exchange Online。如果應顯示的通訊清單的使用者不,這些使用者的必要的屬性值變更為暫時的值,並再回到地址清單所需的值。您可以更新中的 EAC 或 PowerShell 中的使用者屬性值,但會將大量 PowerShell 中的作業速度較快。The Update-AddressList cmdlet isn't available in Exchange Online. If users that should appear an address list do not, change the required property value for those users to a temporary value, and then back to the value that's required by the address list. You can update the user property values in the EAC or PowerShell, but it's quicker to do bulk operations in PowerShell.

例如,假設名為奧的地址清單及華盛頓使用者使用篩選器{((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington') -or (StateOrProvince -eq 'Oregon')))},但的地址清單不包含任何人正確設定其StateOrProvince屬性值。若要更新的地址清單,請執行下列步驟:For example, suppose the address list named Oregon and Washington Users uses the filter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington') -or (StateOrProvince -eq 'Oregon')))}, but the address list doesn't include everyone whose StateOrProvince property values are set correctly. To update the address list, perform the following steps:

  1. 若要尋找應通訊清單中的所有使用者使用通訊清單的查詢。例如:Use the query from the address list to find all users that should be in the address list. For example:

    $Before = Get-User -Filter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Oregon') -or (StateOrProvince -eq 'Washington')))} -ResultSize Unlimited
    
  2. 變更 required 的屬性設為暫時的值。例如變更StateOrProvince值從OregonOR,及WashingtonWAChange the required property to a temporary value. For example, change the StateOrProvince values from Oregon to OR, and Washington to WA:

    $Before | where {$_.StateOrProvince -eq 'Oregon'} | foreach {Set-User $_.Identity -StateOrProvince OR}
    
    $Before | where {$_.StateOrProvince -eq 'Washington'} | foreach {Set-User $_.Identity -StateOrProvince WA}
    
  3. 再次找到這些相同的使用者所使用的暫時屬性值。例如:Find those same users again by using the temporary property values. For example:

    $After = Get-User -Filter {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'OR') -or (StateOrProvince -eq 'WA')))} -ResultSize Unlimited
    
  4. 暫存的值變更回必要的值。例如變更StateOrProvince值從OROregon,及WAWashingtonChange the temporary value back to the required value. For example, change the StateOrProvince values from OR to Oregon, and WA to Washington:

    $After | where {$_.StateOrProvince -eq 'OR'} | foreach {Set-User $_.Identity -StateOrProvince Oregon}
    
    $After | where {$_.StateOrProvince -eq 'WA'} | foreach {Set-User $_.Identity -StateOrProvince Washington}
    

    注意:Notes:

  • 某些屬性需要Get-userSet-user指令程式,而其他人需要Get-mailboxSet-mailbox指令程式 (例如CustomAttribute1-15 )。如需詳細資訊,請參閱下列主題:Some properties require the Get-User and Set-User cmdlets, while others require the Get-Mailbox and Set-Mailbox cmdlets (for example, CustomAttribute1-15 ). For more information, see the following topics:

  • 上述範例顯示糟的情況下任何人出現的位置的地址清單中。如果只有少數使用者不會出現在地址清單,您可以修改每位使用者的必要的屬性值。例如:The previous example shows the worst case scenario where no one appears in the address list. If a only small number of users don't appear in the address list, you can modify the required property value for each user. For example:

  1. 設定使用者的暫存屬性值:Set a temporary property value for the user:

    Set-User <Identity> -StateOrProvince WA
    
  2. 暫存的值變更回必要的值:Change the temporary value back to the required value:

    Set-User <Identity> -StateOrProvince Washington
    

刪除通訊清單Delete an address list

此範例會移除通訊清單 Sales Department,其中不包含子通訊清單。This example removes the address list Sales Department, which doesn't contain child address lists.

Remove-AddressList -Identity "Sales Department"

輸入 Y 以確認您要移除此通訊清單,然後按 ENTER。Type Y to confirm that you want to remove this address list, and then press ENTER.

如需詳細的語法及參數資訊,請參閱 Remove-AddressListFor detailed syntax and parameter information, see Remove-AddressList.