Set-PowerShellVirtualDirectory

此 cmdlet 仅适用于本地 Exchange。

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

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

语法

Default (默认值)

Set-PowerShellVirtualDirectory
    [-Identity] <VirtualDirectoryIdParameter>
    [-BasicAuthentication <Boolean>]
    [-CertificateAuthentication <Boolean>]
    [-Confirm]
    [-DomainController <Fqdn>]
    [-ExtendedProtectionFlags <MultiValuedProperty>]
    [-ExtendedProtectionSPNList <MultiValuedProperty>]
    [-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
    [-ExternalUrl <Uri>]
    [-InternalUrl <Uri>]
    [-RequireSSL <Boolean>]
    [-WhatIf]
    [-WindowsAuthentication <Boolean>]
    [<CommonParameters>]

说明

虽然可以修改 Windows PowerShell 虚拟目录,但我们建议仅在 Microsoft 客户服务和支持部门请求时才这样做。

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

示例

示例 1

Set-PowerShellVirtualDirectory "Contoso (default Web site)" -ExternalUrl "https://www.contoso.com/powershell"

此示例修改 Contoso Windows PowerShell 虚拟目录的外部 URL。

参数

-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 参数指定是否在 Windows PowerShell 虚拟目录上启用证书身份验证。 有效值为 $true 和 $false。 默认值为 $false。

参数属性

类型: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

-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 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 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 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。

参数属性

类型:Uri
默认值: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

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

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

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

参数属性

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

参数集

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

-InternalUrl

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

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

参数属性

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

参数集

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

-RequireSSL

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

RequireSSL 参数指定到虚拟目录的客户端连接是否需要传输层安全性 (TLS) 加密。 有效值包含:

  • $true:需要 TLS 加密才能连接到虚拟目录。 此值为默认值。
  • $false:连接到虚拟目录不需要 TLS 加密。

参数属性

类型: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

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 不返回任何数据。