Set-Contact
此 cmdlet 可在本地 Exchange 和基于云的服务中使用。 一些参数和设置可能只适用于某个特定的环境。
使用 Set-Contact cmdlet 修改联系人对象设置。 如果联系人是邮件联系人,则可以使用 Set-MailContact cmdlet 修改无法使用 Set-Contact cmdlet 的其他 Microsoft Exchange 设置。
有关以下语法部分的参数设置的详细信息,请参阅 Exchange cmdlet 语法。
语法
Set-Contact
[-Identity] <ContactIdParameter>
[-AllowUMCallsFromNonUsers <AllowUMCallsFromNonUsersFlags>]
[-AssistantName <String>]
[-City <String>]
[-Company <String>]
[-Confirm]
[-CountryOrRegion <CountryInfo>]
[-CreateDTMFMap <Boolean>]
[-Department <String>]
[-DisplayName <String>]
[-DomainController <Fqdn>]
[-Fax <String>]
[-FirstName <String>]
[-GeoCoordinates <GeoCoordinates>]
[-HomePhone <String>]
[-IgnoreDefaultScope]
[-Initials <String>]
[-LastName <String>]
[-Manager <UserContactIdParameter>]
[-MobilePhone <String>]
[-Name <String>]
[-Notes <String>]
[-Office <String>]
[-OtherFax <MultiValuedProperty>]
[-OtherHomePhone <MultiValuedProperty>]
[-OtherTelephone <MultiValuedProperty>]
[-Pager <String>]
[-Phone <String>]
[-PhoneticDisplayName <String>]
[-PostalCode <String>]
[-PostOfficeBox <MultiValuedProperty>]
[-SeniorityIndex <Int32>]
[-SimpleDisplayName <String>]
[-StateOrProvince <String>]
[-StreetAddress <String>]
[-TelephoneAssistant <String>]
[-Title <String>]
[-UMCallingLineIds <MultiValuedProperty>]
[-UMDtmfMap <MultiValuedProperty>]
[-WebPage <String>]
[-WhatIf]
[-WindowsEmailAddress <SmtpAddress>]
[<CommonParameters>]
说明
您必须先获得权限,然后才能运行此 cmdlet。 虽然本主题中列出了此 cmdlet 的所有参数,但如果这些参数并未包含在分配给您的权限中,那么您将无法使用这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。
示例
示例 1
Set-Contact -Identity "contoso.com/Users/Arlene Huff" -City "Seattle" -Company "Contoso"
此示例对 Active Directory 域 contoso.com 用户容器中名为 Arlene Huff 的现有联系人进行以下更改:
将 City 参数值更改为“Seattle”。
将 Company 参数值更改为“Contoso”。
参数
-AllowUMCallsFromNonUsers
此参数只在本地 Exchange 中可用。
AllowUMCallsFromNonUsers 参数指定是否从统一消息目录搜索中排除联系人。
Type: | AllowUMCallsFromNonUsersFlags |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-AssistantName
AssistantName 参数指定联系人助理的姓名。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-City
City 参数指定联系人所在的城市。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Company
Company 参数指定联系人所在的公司。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Confirm
Confirm 开关指定是否显示确认提示。 此开关对 cmdlet 造成的影响取决于在你继续操作之前 cmdlet 是否需要确认。
- 破坏性 cmdlet (例如,Remove-* cmdlet) 具有内置的暂停,该暂停会强制你在继续操作之前确认命令。 对于这些 cmdlet,您可以使用此确切语法跳过确认提示:
-Confirm:$false
。 - 大多数其他 cmdlet (例如,New-* 和 Set-* cmdlet) 没有内置暂停。 对于这些 cmdlet,指定不含值的 Confirm 开关会引入暂停,从而强制要求你先确认命令,然后再继续操作。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-CountryOrRegion
CountryOrRegion 参数指定联系人所在的国家/地区。 有效值是有效的 ISO 3166-1 双字母国家/地区代码 (例如,澳大利亚的 AU) 或国家/地区 (的相应友好名称,这可能不同于官方的 ISO 3166 维护机构短名称) 。
国家/地区代码列表中提供了双字母国家/ 地区代码的参考。
友好名称由 Get-Contact cmdlet 在 CountryOrRegion 属性值中返回,但可以在筛选器操作中使用友好名称或双字母国家/地区代码。
Type: | CountryInfo |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-CreateDTMFMap
此参数只在本地 Exchange 中可用。
CreateDTMFMap 参数指定是否为收件人创建双音多频 (DTMF) 映射。 这允许在统一消息 (UM) 环境中使用电话键盘来标识收件人。 有效值包含:
- $true:为收件人创建 DTMF 映射。 此值为默认值。
- $true:为收件人创建 DTMF 映射。此为默认值。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-Department
Department 参数指定联系人所在的部门。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-DisplayName
DisplayName 参数指定联系人的显示名称。 显示名称在 Exchange 管理中心和地址列表中可见。 长度不得超过 256 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
仅当联系人已启用邮件时,此参数才有意义。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-DomainController
此参数只在本地 Exchange 中可用。
DomainController 参数指定此 cmdlet 从 Active Directory 读取数据或向其写入数据时使用的域控制器。 可以使用完全限定的域名 (FQDN) 来标识域控制器。 例如,dc01.contoso.com。
Type: | Fqdn |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-Fax
Fax 参数指定联系人的传真号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-FirstName
FirstName 参数指定用户的名字。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-GeoCoordinates
GeoCoordinates 参数指定触点的纬度、经度和 (位置(可选) 高度坐标)。 此参数的有效值使用以下格式之一:
- 纬度和经度:例如,“47.644125;-122.122411”
- 纬度、经度和高度:例如“47.644125;-122.122411;161.432”
注意:如果句点分隔符不起作用,请改用逗号。
Type: | GeoCoordinates |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-HomePhone
HomePhone 参数指定联系人的家庭电话号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Identity
Identity 参数指定要修改的联系人。 可以使用唯一标识该联系人的任何值。 例如:
- 名称
- 可分辨名称 (DN)
- 可分辨名称 (DN)
- GUID
Type: | ContactIdParameter |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-IgnoreDefaultScope
此参数只在本地 Exchange 中可用。
IgnoreDefaultScope 开关指示命令忽略 Exchange PowerShell 会话的默认收件人范围设置,并将整个林用作范围。 不必为此开关指定值。
此开关使命令能够访问当前在默认范围中不可用的 Active Directory 对象,但也引入了以下限制:
- 无法使用 DomainController 参数。 此命令自动使用相应的全局编录服务器。
- 无法使用 DomainController 参数。 此命令自动使用相应的全局编录服务器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-Initials
Initials 参数指定用户姓名的中间名首字母。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-LastName
LastName 参数指定用户的姓氏。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Manager
Manager 参数指定联系人的经理。
Type: | UserContactIdParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-MobilePhone
MobilePhone 参数指定联系人的主要移动电话号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Name
Name 参数指定联系人的唯一名称。 最大长度为 64 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Notes
Notes 参数指定对象的其他信息。 如果值中有空格,请使用双引号 (") 将此值括起来。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Office
Office 参数指定用户的实际办公室名称或号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-OtherFax
OtherFax 参数指定联系人的备用传真号码。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-OtherHomePhone
OtherHomePhone 参数指定联系人的备用家庭电话号码。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-OtherTelephone
OtherTelephone 参数指定联系人的备用办公室电话号码。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Pager
Pager 参数指定联系人的寻呼机号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Phone
Phone 参数指定联系人的办公室电话号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-PhoneticDisplayName
PhoneticDisplayName 参数指定在统一消息 (UM) 环境中进行文本到语音转换时使用的用户名的备用拼写。 通常在用户名的发音和拼写不匹配时使用此参数。 长度不得超过 256 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-PostalCode
PostalCode 参数指定联系人所在地的邮政编码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-PostOfficeBox
PostOfficeBox 参数指定联系人的信箱号码。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-SeniorityIndex
SeniorityIndex 参数指定此联系人在分层通讯簿中的显示顺序。 在通讯簿中,值为 2 的联系人显示在值为 1 的联系人的前面。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-SimpleDisplayName
当仅允许一组有限的字符时,SimpleDisplayName 参数用于显示对象的替代说明。 有效字符为:
- 如果只允许使用一组有限的字符,则 SimpleDisplayName 参数用于显示对象的备用说明。有效字符包括:
- a – z
- A - Z
- 空格
" ' ( ) + , - . / : ?
仅当联系人已启用邮件时,此参数才有意义。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-StateOrProvince
StateOrProvince 参数指定联系人所在的省/市/自治区。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-StreetAddress
StreetAddress 参数指定联系人的实际地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-TelephoneAssistant
TelephoneAssistant 参数指定联系人助理的电话号码。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-Title
Title 参数指定联系人的职务。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-UMCallingLineIds
此参数只在本地 Exchange 中可用。
UMCallingLineIds 参数指定可映射到已启用统一消息 (UM) 的用户的电话号码或分机。 可以为每个用户指定多个逗号分隔的电话号码。 此参数的值的长度必须小于 128 个字符,可以在数字之前包含可选的加号 (+)。 每个已启用 UM 的用户必须具有唯一的 UMCallingLineIds 参数值。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-UMDtmfMap
此参数只在本地 Exchange 中可用。
UMDtmfMap 参数指定双音多频 (DTMF) 收件人的映射值。 这允许在统一消息 (UM) 环境中使用电话键盘来标识收件人。 通常,会自动创建和更新这些 DTMF 值,但可以使用此参数手动进行更改。 此参数使用以下语法:
emailAddress:<integers>
lastNameFirstName:<integers>
firstNameLastName:<integers>
若要输入覆盖所有现有条目的值,请使用以下语法: emailAddress:<integers>,lastNameFirstName:<integers>,firstNameLastName:<integers>
。
如果使用此语法并省略任何 DTMF 映射值,则这些值将从接收方中删除。 例如,如果仅 emailAddress:<integers>
指定 ,则将删除所有现有的 lastNameFirstName 和 firstNameLastName 值。
若要在不影响其他现有条目的情况下添加或删除值,请使用以下语法: @{Add="emailAddress:<integers>","lastNameFirstName:<integers>","firstNameLastName:<integers>"; Remove="emailAddress:<integers>","lastNameFirstName:<integers>","firstNameLastName:<integers>"}
。
如果使用此语法,则无需指定所有 DTMF 映射值,并且可以指定多个 DTMF 映射值。 例如,可以使用 @{Add="emailAddress:<integers1>","emailAddress:<integers2>}
为 emailAddress 添加两个新值,而不会影响现有的 lastNameFirstName 和 firstNameLastName 值。
Type: | MultiValuedProperty |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019 |
-WebPage
WebPage 参数指定联系人的网页。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-WhatIf
WhatIf 开关模拟命令操作。 可以使用此开关在不实际应用将会发生的更改的情况下预览这些更改。 不必为此开关指定值。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
-WindowsEmailAddress
WindowsEmailAddress 参数指定此收件人的 Windows 电子邮件地址。 这是存在于所有环境(包括没有 Exchange 的环境)中的常见 Active Directory 属性。 对收件人使用 WindowsEmailAddress 参数会产生以下结果之一:
- 在收件人受电子邮件地址策略约束 (EmailAddressPolicyEnabled 属性设置为收件人) 值 True 的环境中,WindowsEmailAddress 参数对 WindowsEmailAddress 属性或主电子邮件地址值没有影响。
- 在收件人不受电子邮件地址策略约束的环境中, (EmailAddressPolicyEnabled 属性设置为收件人) 的值 False,WindowsEmailAddress 参数将 WindowsEmailAddress 属性和主电子邮件地址更新为相同的值。
WindowsEmailAddress 属性对于电子邮件属性中的Active Directory 用户和计算机收件人可见。 属性公用名为“E-mail-Addresses”,Ldap-Display-Name 为“邮件”。 如果在 Active Directory 中修改此属性,则收件人的主电子邮件地址不会更新为相同的值。
Type: | SmtpAddress |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online, Exchange Online Protection |
输入
Input types
若要了解此 cmdlet 接受的输入类型,请参阅 cmdlet 的输入和输出类型。 如果 cmdlet 的"输入类型"字段为空,则表明此 cmdlet 不接受输入数据。
输出
Output types
若要了解此 cmdlet 接受的返回类型(亦称为"输出类型"),请参阅 cmdlet 的输入和输出类型。 如果"输出类型"字段为空,则表明此 cmdlet 不返回任何数据。