New-MessageClassification
此 cmdlet 可在本地 Exchange 和基于云的服务中使用。 某些参数和设置可能只属于一个环境或另一个环境。
使用 New-MessageClassification cmdlet 可以在组织中创建邮件分类实例。
有关以下语法部分的参数设置的详细信息,请参阅 Exchange cmdlet 语法。
语法
Localized
New-MessageClassification
[-Name] <String>
-DisplayName <String>
-Locale <CultureInfo>
-SenderDescription <String>
[-Confirm]
[-DomainController <Fqdn>]
[-RecipientDescription <String>]
[-WhatIf]
[<CommonParameters>]
Identity
New-MessageClassification
[-Name] <String>
-DisplayName <String>
-SenderDescription <String>
[-ClassificationID <Guid>]
[-Confirm]
[-DisplayPrecedence <ClassificationDisplayPrecedenceLevel>]
[-DomainController <Fqdn>]
[-PermissionMenuVisible <Boolean>]
[-RecipientDescription <String>]
[-RetainClassificationEnabled <Boolean>]
[-WhatIf]
[<CommonParameters>]
说明
新建邮件分类之后,可以将邮件分类指定为传输规则谓词。 在Microsoft Outlook 和Outlook 网页版用户可以将邮件分类应用于邮件之前,需要使用由 Export-OutlookClassification.ps1 脚本文件创建的邮件分类 XML 文件更新最终用户系统。 脚本文件 Export-OutlookClassification.ps1 位于 %ExchangeInstallPath%Scripts 目录中。
创建邮件分类时,该分类没有区域设置。 默认情况下,新邮件分类用于所有区域设置。 定义了默认邮件分类之后,可以通过运行 New-MessageClassification cmdlet 以及指定要本地化的默认邮件分类标识,添加新的分类区域设置。
您必须先获得权限,然后才能运行此 cmdlet。 尽管本文列出了 cmdlet 的所有参数,但如果某些参数未包含在分配给你的权限中,则可能无法访问这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。
示例
示例 1
New-MessageClassification -Name "My Message Classification" -DisplayName "New Message Classification" -SenderDescription "This is the description text"
此示例使用以下属性创建名为“我的邮件分类”的消息分类:
- 显示名称为 New Message Classification。
- 发件人描述为“This is the description text”。
示例 2
New-MessageClassification -Name "My Message Classification" -Locale es-ES -DisplayName "España Example" -SenderDescription "Este es el texto de la descripción"
在本地 Exchange 中,此示例创建一个特定于区域设置 (西班牙语 - 西班牙) 名为“我的邮件分类”的现有邮件分类版本。
参数
-ClassificationID
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
ClassificationID 参数指定要在 Exchange 组织中导入和使用的现有邮件分类的分类 ID (GUID) 。 如果要配置跨同一组织中的两个 Exchange 林的邮件分类,请使用此参数。
若要查找邮件分类的 ClassificationID 值,请将 替换为 <MessageClassificationName> 邮件分类的名称,并运行以下命令: Get-MessageClassification -Identity "<MessageClassificationName>"。
参数属性
| 类型: | Guid |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
Identity
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Confirm
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
Confirm 开关指定是否显示确认提示。 此开关对 cmdlet 造成的影响取决于在你继续操作之前 cmdlet 是否需要确认。
- 破坏性 cmdlet(例如 Remove-* cmdlets)内置有暂停,可强制要求先确认命令,然后再继续操作。 对于这些 cmdlet,您可以使用此确切语法跳过确认提示:
-Confirm:$false。 - 其他大多数 cmdlet(例如 New-* 和 Set-* cmdlet)都没有内置暂停。 对于这些 cmdlet,指定不含值的 Confirm 开关会引入暂停,从而强制要求你先确认命令,然后再继续操作。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | cf |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DisplayName
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
DisplayName 参数指定在 Outlook 中显示并由用户选择的邮件分类的标题。 长度不得超过 256 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
发件人的计算机上必须存在邮件分类 XML 文件,才能显示其显示名。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DisplayPrecedence
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
DisplayPrecedence 参数指定邮件分类相对于可能应用于指定邮件的其他邮件分类的相对优先级。 有效值包含:
- Highest
- Higher
- 高
- MediumHigh
- 中等 (默认值)
- MediumLow
- 低
- Lower
- Lowest
虽然 Outlook 仅允许用户为邮件指定单个分类,但传输规则可能会对邮件应用其他分类。 首先显示优先级最高的分类,后续分类(即此参数定义的优先级较低的分类)将按相应的顺序追加。
参数属性
| 类型: | ClassificationDisplayPrecedenceLevel |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
Identity
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DomainController
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019
此参数只在本地 Exchange 中可用。
DomainController 参数指定此 cmdlet 从 Active Directory 读取数据或向其写入数据时使用的域控制器。 可以使用完全限定的域名 (FQDN) 来标识域控制器。 例如,dc01.contoso.com。
边缘传输服务器上不支持 DomainController 参数。 边缘传输服务器使用活动目录轻型目录服务 (AD LDS) 的本地实例来读取和写入数据。
参数属性
| 类型: | Fqdn |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Locale
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
此参数在本地 Exchange 中正常运行。
Locale 参数指定现有消息分类的区域设置特定版本。 使用 -Name 参数标识现有邮件分类,使用 SenderDescription 参数指定其他语言的描述性文本。
此参数的有效值是 Microsoft .NET Framework CultureInfo 类 (支持的区域性代码值,例如,da-DK 表示丹麦语,ja-JP 表示日语) 。 有关详细信息,请参阅 CultureInfo 类。
参数属性
| 类型: | CultureInfo |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
Localized
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Name
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
Name 参数指定消息分类的唯一名称。 最大长度为 64 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-PermissionMenuVisible
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
PermissionMenuVisible 参数指定用户撰写邮件时,是否在 Outlook 中显示为 DisplayName 和 RecipientDescription 参数输入的值。 有效值包含:
- $true:用户可以在邮件发送之前将邮件分类分配给邮件,并显示分类信息。 此值为默认值。
- $false:用户无法在发送邮件前将邮件分类分配给邮件,但是,使用此邮件分类收到的邮件仍显示分类信息。
参数属性
| 类型: | Boolean |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
Identity
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-RecipientDescription
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
RecipientDescription 参数指定在 Outlook 收件人收到应用邮件分类的邮件时显示的详细文本。 最大长度为 1024 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
如果不使用此参数,则使用 SenderDescription 参数的值。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-RetainClassificationEnabled
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
RetainClassificationEnabled 参数指定转发或答复邮件时,是否应为邮件保留邮件分类。
默认值为 $true。
参数属性
| 类型: | Boolean |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
Identity
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-SenderDescription
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
SenderDescription 参数指定在 Outlook 发件人在发送邮件前选择要应用于邮件的邮件分类时显示的详细文本。 最大长度为 1024 个字符。 如果值中有空格,请使用双引号 (") 将此值括起来。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Online
WhatIf 开关模拟命令操作。 可以使用此开关在不实际应用将会发生的更改的情况下预览这些更改。 不必为此开关指定值。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | 无线 |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输入
Input types
若要了解此 cmdlet 接受的输入类型,请参阅 cmdlet 的输入和输出类型。 如果 cmdlet 的"输入类型"字段为空,则表明此 cmdlet 不接受输入数据。
输出
Output types
若要了解此 cmdlet 接受的返回类型(亦称为"输出类型"),请参阅 cmdlet 的输入和输出类型。 如果"输出类型"字段为空,则表明此 cmdlet 不返回任何数据。