Set-WebServicesVirtualDirectory

此 cmdlet 仅适用于本地 Exchange。

使用 Set-WebServicesVirtualDirectory cmdlet 修改 Microsoft Exchange 服务器上的 Internet Information Services (IIS) 中使用的现有 Exchange Web 服务虚拟目录。

有关以下语法部分的参数设置的详细信息,请参阅 Exchange cmdlet 语法。

语法

Default (默认值)

Set-WebServicesVirtualDirectory
    [-Identity] <VirtualDirectoryIdParameter>
    [-BasicAuthentication <Boolean>]
    [-CertificateAuthentication <Boolean>]
    [-Confirm]
    [-DigestAuthentication <Boolean>]
    [-DomainController <Fqdn>]
    [-ExtendedProtectionFlags <MultiValuedProperty>]
    [-ExtendedProtectionSPNList <MultiValuedProperty>]
    [-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
    [-ExternalUrl <Uri>]
    [-Force]
    [-GzipLevel <GzipLevel>]
    [-InternalNLBBypassUrl <Uri>]
    [-InternalUrl <Uri>]
    [-MRSProxyEnabled <Boolean>]
    [-MRSProxyMaxConnections <Unlimited>]
    [-OAuthAuthentication <Boolean>]
    [-WhatIf]
    [-WindowsAuthentication <Boolean>]
    [-WSSecurityAuthentication <Boolean>]
    [<CommonParameters>]

说明

您必须先获得权限,然后才能运行此 cmdlet。 尽管本文列出了 cmdlet 的所有参数,但如果分配给你的权限中未包含某些参数,则可能无权访问这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。

示例

示例 1

Set-WebServicesVirtualDirectory -Identity Contoso\EWS(Default Web Site) -ExternalUrl https://www.contoso.com/EWS/exchange.asmx -BasicAuthentication $true -InternalUrl https://contoso.internal.com/EWS/exchange.asmx

本示例将服务器 Contoso 上的虚拟目录 EWS 的身份验证方法设置为基本身份验证。 此示例还设置了此虚拟目录的外部 URL 和内部 URL。

示例 2

Set-WebServicesVirtualDirectory -Identity Contoso\EWS* -ExternalUrl https://www.contoso.com/EWS/exchange.asmx

本示例使用通配符而不是在示例 1 中使用的“Default Web site”。

示例 3

Set-WebServicesVirtualDirectory -Identity "EWS (Default Web Site)" -MRSProxyEnabled $true

此示例在 EWS 默认网站上启用 MRSProxy。 MRSProxy 是负责帮助进行远程邮箱移动的服务。

参数

-BasicAuthentication

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

BasicAuthentication 参数指定是否在虚拟目录上启用基本身份验证。 有效值包含:

  • $true:已启用基本身份验证。 此值为默认值。
  • $true:启用基本身份验证。此为默认值。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-CertificateAuthentication

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

CertificateAuthentication 参数指定是否启用证书身份验证。 此参数影响 <Servername>/ews/management/ 虚拟目录。 它不会影响 <Servername>/ews/ 虚拟目录。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

Confirm 开关指定是否显示确认提示。 此开关对 cmdlet 有何影响取决于 cmdlet 在继续操作前是否需要确认。

  • 破坏性 cmdlet(例如 Remove-* cmdlets)内置有暂停,可强制要求先确认命令,然后再继续操作。 对于这些 cmdlet,您可以使用此确切语法跳过确认提示:-Confirm:$false。
  • 其他大多数 cmdlet(例如 New-* 和 Set-* cmdlet)都没有内置暂停。 对于这些 cmdlet,在不带值的情况下指定“确认”开关会引入一个暂停,从而强制你在继续之前确认命令。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DigestAuthentication

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

DigestAuthentication 参数指定是否在虚拟目录上启用摘要式身份验证。 有效值包含:

  • $true:已启用摘要式身份验证。
  • $false:摘要式身份验证已禁用。 此值为默认值。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DomainController

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

DomainController 参数指定此 cmdlet 从 Active Directory 读取数据或向其写入数据时使用的域控制器。 可以使用完全限定的域名 (FQDN) 来标识域控制器。 例如,dc01.contoso.com。

参数属性

类型:Fqdn
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ExtendedProtectionFlags

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

ExtendedProtectionFlags 参数指定虚拟目录上身份验证扩展保护的自定义设置。 有效值包含:

  • 无:这是默认设置。
  • AllowDotlessSPN:如果要使用服务主体名称 (SPN) 不包含 FQDN 的值,则必需 (例如 HTTP/ContosoMail 而不是 HTTP/mail.contoso.com) 。 您可以使用 ExtendedProtectionSPNList 参数指定 SPN。 此设置降低了身份验证扩展保护的安全性,因为无点证书并不唯一,因此无法确保客户端到代理的连接是通过安全通道建立的。
  • NoServiceNameCheck:不会检查 SPN 列表来验证通道绑定令牌。 此设置会降低针对身份验证的扩展保护的安全性。 通常,建议不使用此设置。
  • 代理:代理服务器负责终止 TLS 通道。 若要使用此设置,需要使用 ExtendedProtectionSPNList 参数注册一个 SPN。
  • ProxyCoHosting:HTTP 和 HTTPS 流量可能正在访问虚拟目录,并且代理服务器至少位于某些客户端和 Exchange 服务器上的客户端访问服务之间。

参数属性

类型:MultiValuedProperty
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ExtendedProtectionSPNList

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

ExtendedProtectionSPNList 参数指定有效的服务主体名称列表 (SPN,) 如果你在虚拟目录上使用针对身份验证的扩展保护。 有效值包含:

  • $null:此值为默认值。
  • 单个 SPN 或逗号分隔的有效 SPN 列表:SPN 值格式为 Protocol\FQDN。 例如,HTTP/mail.contoso.com。 若要添加不是 FQDN (的 SPN(例如 HTTP/ContosoMail) ),还需要将 AllowDotlessSPN 值用于 ExtendedProtectionFlags 参数。

参数属性

类型:MultiValuedProperty
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ExtendedProtectionTokenChecking

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

ExtendedProtectionTokenChecking 参数指定是否将身份验证扩展保护用于到虚拟目录的客户端连接。 有效值包含:

  • 无:身份验证扩展保护不用于客户端到虚拟目录的连接。 此值为默认值。
  • 允许:如果客户端和服务器都支持,则将“身份验证扩展保护”用于客户端到虚拟目录的连接。
  • 需要:客户端连接到虚拟目录需要身份验证扩展保护。 如果客户端或服务器不支持,则连接失败。 此值还需要 ExtendedProtectionSPNList 参数的服务主体名称 (SPN) 值。

注意:如果 Exchange 服务器前面的代理服务器终止客户端到代理传输层安全 (TLS) 通道,则值“允许”或“需要”需要一个或多个 SPN 值用于 ExtendedProtectionSPNList 参数。

参数属性

类型:ExtendedProtectionTokenCheckingMode
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ExternalUrl

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

ExternalURL 参数指定从防火墙外部连接到虚拟目录的 URL。

当连接通过传输层安全性 (TLS) 加密时,此参数的值非常重要。

参数属性

类型:Uri
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Force

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

Force 开关会隐藏警告或确认消息。 不必为此开关指定值。

您可以在以编程方式运行任务时使用此开关,因为此时并不适合提示用户提供管理输入。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-GzipLevel

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

GzipLevel 参数设置 Exchange Web 服务虚拟目录的 Gzip 配置。 有效值包含:

  • 关:无压缩。
  • 低:仅静态压缩。 此值为默认值。 此值与 Off 值具有相同的结果,因为 Exchange Web 服务内容是动态的。
  • 高:静态和动态压缩。 如果客户端在其请求中指示支持 Gzip 压缩,则会压缩 Exchange Web 服务中的内容。
  • 错误:标识 Gzip 压缩配置中的错误。

参数属性

类型:GzipLevel
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Identity

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

标识参数指定要修改的 EWS 虚拟目录。 可以使用唯一标识虚拟目录的任何值。 例如:

  • 名称或服务器\名称
  • 可分辨名称 (DN)
  • GUID

Name 值使用虚拟目录属性中的语法 "VirtualDirectoryName (WebsiteName)" 。 可以通过使用语法 VirtualDirectoryName*指定通配符 (*) 而不是默认网站。

参数属性

类型:VirtualDirectoryIdParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-InternalNLBBypassUrl

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

注意: 此参数仅适用于 Exchange 2010。 默认情况下,Exchange 2013 或更高版本已在后端 Exchange Web 服务 (邮箱服务器上的 EWS) 虚拟目录上配置了 InternalNLBBypassUrl 值。

InternalNLBBypassUrl 参数指定安装了客户端访问服务器角色的 Exchange 服务器的 URL,无论它是否位于网络负载均衡 (NLB) 数组后面。

当您将 InternalUrl 参数设置为 NLB 阵列的 URL 时,应将 InternalNLBBypassUrl 参数设置为客户端访问服务器本身的 URL。

参数属性

类型:Uri
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InternalUrl

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

InternalURL 参数指定从防火墙内部连接到虚拟目录的 URL。

当连接通过传输层安全性 (TLS) 加密时,此参数的值非常重要。

参数属性

类型:Uri
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-MRSProxyEnabled

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

MRSProxyEnabled 参数指定是否为安装了客户端访问服务器角色的 Exchange 服务器上的 Exchange Web 服务虚拟目录启用 MRSProxy。 MRSProxy 有助于在 Active Directory 林之间代理邮箱移动。 默认值为 $false。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-MRSProxyMaxConnections

适用:Exchange Server 2010

MRSProxyMaxConnections 参数指定 MRSProxy 实例接受的最大同时移动会话数。 此设置接受 0 到无限制之间的值。 默认值为 100。 有关 MRSProxy 的详细信息,请参阅 了解移动请求。

参数属性

类型:Unlimited
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-OAuthAuthentication

适用:Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

OAuthAuthentication 参数指定是否在虚拟目录上启用 OAuth 身份验证。 有效值包含:

  • $true:启用 OAuth 身份验证。 此值为默认值。
  • $false:OAuth 身份验证已禁用。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

WhatIf 开关显示命令执行的操作,而无需进行任何更改。 不必为此开关指定值。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:WI

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WindowsAuthentication

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

WindowsAuthentication 参数指定是否在虚拟目录上启用集成 Windows 身份验证。 有效值包含:

  • $true:已启用集成Windows 身份验证。 此值为默认值。
  • $false:禁用集成Windows 身份验证。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WSSecurityAuthentication

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

WSSecurityAuthentication 参数指定是否在虚拟目录上启用 WS-Security (Web 服务安全) 身份验证。 有效值包含:

  • $true:启用 WS-Security 身份验证。 此值为默认值。
  • $true:启用 WS-安全性身份验证。此为默认值。

参数属性

类型:Boolean
默认值: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 不返回任何数据。