简体   繁体   English

通过HTTPS从Powershell远程连接连接交换服务器EMS

[英]connecting exchange server EMS from powershell remoting via HTTPS

I'm trying to resolve an issue we are facing. 我正在尝试解决我们面临的问题。

we are able to communicate to Exchange Server EMS Script from remote machine through winRM HTTP authentication. 我们能够通过winRM HTTP身份验证从远程计算机与Exchange Server EMS脚本进行通信。

$newSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://test.domain.com/PowerShell/ -Authentication Kerberos -Credential $Credentials    
Import-PSSession $newSession

But we have to impose WinRM HTTPS, so I have set everything required for that including certificate creation , winRM settings etc. 但是我们必须强加WinRM HTTPS,因此我已经设置了所需的一切,包括证书创建,winRM设置等。

And we are able to connect to remote machine where exchange server is available: 而且我们能够连接到可以使用交换服务器的远程机器:

Enter-PSSession -ComputerName test.domain.com -Credential $credentials -UseSSL Enter-PSSession -ComputerName test.domain.com-凭据$ credentials -UseSSL

and this works. 这可行。

Now when I'm using -UseSSL in New-PSSession/Enter-PSSession for EMS, its not working: 现在,当我在New-PSSession / Enter-PSSession for EMS中使用-UseSSL时,它不起作用:

$newSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://test.domain.com/PowerShell/ -Credential $Credentials -UseSSL

Error: New-PSSession : Parameter set cannot be resolved using the specified named parameters. 错误:New-PSSession:无法使用指定的命名参数来解析参数集。

Please note: I need WinRM (powershell) Connectivity through HTTPS: -UseSSL Authentication. 请注意:我需要通过HTTPS的WinRM(powershell)连接:-UseSSL身份验证。 Not with Kerberos/Defaut/CredSSP 不适用于Kerberos / Defaut / CredSSP

You need to look at parameter sets in the documentation https://technet.microsoft.com/en-us/library/hh849717.aspx eg when you using URI eg 您需要查看文档https://technet.microsoft.com/zh-cn/library/hh849717.aspx中的参数集,例如在使用URI时

Parameter Set: Uri New-PSSession [-ConnectionUri] [-AllowRedirection] [-Authentication {Default | 参数集:Uri New-PSSession [-ConnectionUri] [-AllowRedirection] [-Authentication {默认| Basic | 基本 Negotiate | 洽谈| NegotiateWithImplicitCredential | 与ImplicitCredential协商| Credssp | Credssp | Digest | 文摘 Kerberos} ] [-CertificateThumbprint ] [-ConfigurationName ] [-Credential ] [-EnableNetworkAccess] [-Name ] [-SessionOption ] [-ThrottleLimit ] [ ] Kerberos}] [-CertificateThumbprint] [-ConfigurationName] [-Credential] [-EnableNetworkAccess] [-Name] [-SessionOption] [-ThrottleLimit] []

What you should be doing is specify the https prefix instead of using the -useSSL switch which will ensure that connection is over https (" https://test.domain.com/PowerShell/ );. The -useSSL is meant to be used when you using the -ComputerName parameter. 您应该做的是指定https前缀,而不是使用-useSSL开关,这将确保通过https(“ https://test.domain.com/PowerShell/ )进行连接;。-useSSL用于当您使用-Co​​mputerName参数时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM