New-PowerShellVirtualDirectory

此 cmdlet 仅适用于本地 Exchange。

使用 New-PowerShellVirtualDirectory cmdlet 创建在 Microsoft Exchange 服务器上的 Internet Information Services (IIS) 中使用的Windows PowerShell虚拟目录。

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

语法

Default (默认值)

New-PowerShellVirtualDirectory
    [-Name] <String>
    [-BasicAuthentication <Boolean>]
    [-Confirm]
    [-DomainController <Fqdn>]
    [-ExtendedProtectionFlags <MultiValuedProperty>]
    [-ExtendedProtectionSPNList <MultiValuedProperty>]
    [-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
    [-ExternalUrl <Uri>]
    [-InternalUrl <Uri>]
    [-RequireSSL <Boolean>]
    [-Role <VirtualDirectoryRole>]
    [-Server <ServerIdParameter>]
    [-WhatIf]
    [-WindowsAuthentication <Boolean>]
    [<CommonParameters>]

说明

虽然可以创建 Windows PowerShell 虚拟目录,但我们建议仅在 Microsoft 客户服务和支持部门请求时创建此操作。

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

示例

示例 1

New-PowerShellVirtualDirectory -Name "Contoso Certificates Required" -BasicAuthentication $false -WindowsAuthentication $false -CertificateAuthentication $true

此示例创建一个 Windows PowerShell 虚拟目录,并将其配置为仅接受证书身份验证。

参数

-BasicAuthentication

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

BasicAuthentication 参数指定是否对 PowerShell 虚拟目录启用基本身份验证。 有效值为 $true 和 $false。 默认值为 $true。

参数属性

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

参数集

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

-Confirm

适用: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 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 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 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

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

参数属性

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

参数集

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

-InternalUrl

适用: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

-Name

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

Name 参数指定新 PowerShell 虚拟目录的名称。 你提供的名称会附加在其下创建的网站的名称。 如果您提供的名称中包含空格,请使用引号 (") 括住该名称。

参数属性

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

参数集

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

-RequireSSL

适用: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

-Role

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

角色参数指定虚拟目录的配置。 有效值包含:

  • ClientAccess:为邮箱服务器上的客户端访问 (前端) 服务配置虚拟目录。
  • 邮箱:为邮箱服务器上的后端服务配置虚拟目录。

客户端连接从客户端访问服务代理到本地或远程邮箱服务器上的后端服务。 客户端不直接连接到后端服务。

参数属性

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

参数集

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

-Server

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

Server 参数指定托管虚拟目录的 Exchange 服务器。 可以使用唯一标识该服务器的任何值。 例如:

  • 名称
  • FQDN
  • 可分辨名称 (DN)
  • ExchangeLegacyDN

参数属性

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

参数集

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

-WhatIf

适用: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 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

WindowsAuthentication 参数指定是否在 PowerShell 虚拟目录上启用集成 Windows 身份验证。 有效值为 $true 和 $false。 默认值为 $true。

参数属性

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