管理 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 Server 版本?请参阅创建地址列表Looking for the Exchange Server 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,请参阅连接到 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 中的地址列表角色不分配给任何角色组。若要使用需要地址列表角色的任何 cmdlet,您需要将角色添加到角色组。有关详细信息,请参阅主题,管理角色组中的"将角色添加到角色组"部分。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.

  • 若要了解可能适用于此主题中过程的键盘快捷键,请参阅 Exchange 管理中心内的键盘快捷键For 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 参数创建地址列表名为"Oregon 和 Washington 用户"的地址列表,包括作为邮箱用户的收件人,并将 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 cmdlet 在 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.

例如,假设名为"Oregon 和 Washington 用户"的地址列表使用筛选器 {((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. 将所需的属性更改为临时值。例如,将 StateOrProvince 值从 Oregon更改到 OR,并且将 Washington更改到 WA:Change 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 值从 OR更改到 Oregon,并且将 WA更改到 Washington:Change 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 cmdlet,而其他属性则需要 Get-MailboxSet-Mailbox cmdlet(例如, 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.