命令行管理(查看和修改)exchange虚拟目录身份认证(启用和禁用)

由于exchange并没有提供全面的图形界面进行参数查看和修改,通过命令行查看和修改相关的配置信息就成了唯一的有效方式,缺点就是需要属性相关的命令和语法,不属性命令和语法就没办法执行对应的任务了,参考官方文档是一个不错的方式,并对常用的命令和语法进行记录和熟悉。

1. AutodiscoverVirtualDirectory

设置合适的认证方式,方便客户端能够快速与服务器建立连接。

 官方命令参考: 

Set-AutodiscoverVirtualDirectory (ExchangePowerShell) | Microsoft Learn您必须先获得权限,然后才能运行此 cmdlet。 虽然本主题中列出了此 cmdlet 的所有参数,但如果这些参数并未包含在分配给您的权限中,那么您将无法使用这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/powershell/module/exchange/set-autodiscovervirtualdirectory?view=exchange-ps

1.1 查看认证

Get-AutoDiscoverVirtualDirectory | FL server,*auth*

Server                        : WIN-IRDSVJO3UTT
InternalAuthenticationMethods : {Basic, WSSecurity}
ExternalAuthenticationMethods : {Basic, WSSecurity}
LiveIdNegotiateAuthentication : False
WSSecurityAuthentication      : True
LiveIdBasicAuthentication     : False
BasicAuthentication           : True
DigestAuthentication          : False
WindowsAuthentication         : False
OAuthAuthentication           : False
AdfsAuthentication            : False

1.2 修改OAuthAuthentication为true

Set-AutodiscoverVirtualDirectory -Identity 'Autodiscover (Default Web Site)' -OAuthAuthentication $true

Get-AutoDiscoverVirtualDirectory | FL server,*auth*

Server                        : WIN-IRDSVJO3UTT
InternalAuthenticationMethods : {Basic, WSSecurity, OAuth}
ExternalAuthenticationMethods : {Basic, WSSecurity, OAuth}
LiveIdNegotiateAuthentication : False
WSSecurityAuthentication      : True
LiveIdBasicAuthentication     : False
BasicAuthentication           : True
DigestAuthentication          : False
WindowsAuthentication         : False
OAuthAuthentication           : True
AdfsAuthentication            : False

注意: 'Autodiscover (Default Web Site)',名称需要用引号引起来,目录名和后面的站点之间需要用空格分隔。

1.3 修改OAuthAuthentication为false

Set-AutodiscoverVirtualDirectory -Identity 'Autodiscover (Default Web Site)' -OAuthAuthentication $false

Get-AutoDiscoverVirtualDirectory | FL server,*auth*

Server                        : WIN-IRDSVJO3UTT
InternalAuthenticationMethods : {Basic, WSSecurity}
ExternalAuthenticationMethods : {Basic, WSSecurity}
LiveIdNegotiateAuthentication : False
WSSecurityAuthentication      : True
LiveIdBasicAuthentication     : False
BasicAuthentication           : True
DigestAuthentication          : False
WindowsAuthentication         : False
OAuthAuthentication           : False
AdfsAuthentication            : False

 2. WebServicesVirtualDirectory

WebServicesVirtualDirectory是ews协议的虚拟目录。

 官方命令参考: 

Set-WebServicesVirtualDirectory (ExchangePowerShell) | Microsoft Learn您必须先获得权限,然后才能运行此 cmdlet。 虽然本主题中列出了此 cmdlet 的所有参数,但如果这些参数并未包含在分配给您的权限中,那么您将无法使用这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。icon-default.png?t=N7T8https://learn.microsoft.com/zh-cn/powershell/module/exchange/set-webservicesvirtualdirectory?view=exchange-ps

2.1 查看认证方式

Get-WebServicesVirtualDirectory | FL server,*url*,*auth*

Server                        : WIN-IRDSVJO3UTT
InternalNLBBypassUrl          :
InternalUrl                   : https://mail.otp.com/ews/exchange.asmx
ExternalUrl                   : https://mail.otp.com/ews/exchange.asmx
CertificateAuthentication     :
InternalAuthenticationMethods : {Basic, WSSecurity}
ExternalAuthenticationMethods : {Basic, WSSecurity}
LiveIdNegotiateAuthentication :
WSSecurityAuthentication      : True
LiveIdBasicAuthentication     : False
BasicAuthentication           : True
DigestAuthentication          : False
WindowsAuthentication         : False
OAuthAuthentication           : False
AdfsAuthentication            : False

2.2 修改OAuthAuthentication为true

Set-WebServicesVirtualDirectory -Identity 'EWS (Default Web Site)' -OAuthAuthentication $true

Get-WebServicesVirtualDirectory | FL server,*url*,*auth*

Server                        : WIN-IRDSVJO3UTT
InternalNLBBypassUrl          :
InternalUrl                   : https://mail.otp.com/ews/exchange.asmx
ExternalUrl                   : https://mail.otp.com/ews/exchange.asmx
CertificateAuthentication     :
InternalAuthenticationMethods : {Basic, WSSecurity, OAuth}
ExternalAuthenticationMethods : {Basic, WSSecurity, OAuth}
LiveIdNegotiateAuthentication :
WSSecurityAuthentication      : True
LiveIdBasicAuthentication     : False
BasicAuthentication           : True
DigestAuthentication          : Fa
  • 21
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值