【问题标题】:How can I connect to Exchange server remotely through Powershell and a PSSessionConfiguration如何通过 Powershell 和 PSSessionConfiguration 远程连接到 Exchange 服务器
【发布时间】:2014-07-13 21:41:35
【问题描述】:

我正在尝试连接以远程交换并从 Powershell 运行查询。

这是我在 Exchange 服务器上的配置文件:

Register-PSSessionConfiguration -Name "Exchange" -StartupScript "C:\ProgramFiles\Microsoft\Exchange Server\V14\Bin\RemoteExchange.ps1"

这是我从本地计算机连接的方式:

$s = New-PSSession -ComputerName cmsexch -ConfigurationName "Exchange" -Authentication Kerberos -credential $cred

这是我收到的错误消息:

New-PSSession:运行启动脚本引发错误:找不到路径“HKLM:\Software\microsoft\ExchangeServer\v14\CentralAdmin”,因为它确实存在 不存在..

注意:

  • 我的本地 Powershell 在 Windows 2008 SP2 32 位上运行
  • 我的远程 Exchange 在 Windows 2008 R2 SP1 64 位上运行

问题:

  • 如何解决此问题?
  • 这是因为注册表重定向器在 Windows 64 位?

非常感谢

【问题讨论】:

    标签: windows powershell registry powershell-remoting


    【解决方案1】:

    本地计算机的连接字符串似乎缺少一些内容。我相信以下代码是您正在寻找的。您需要填写您的 FQDN,仅此而已。这 3 行让我明白了。32/64 位应该没有区别。

    $UserCredential = Get-Credential
    
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of your Exchange server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
    
    Import-PSSession $Session

    这篇 TechNet Exchange 知识文章可能会详细说明或至少为您指明正确的方向。 http://technet.microsoft.com/en-us/library/dd335083%28v=exchg.150%29.aspx

    【讨论】:

      猜你喜欢
      • 2012-09-06
      • 1970-01-01
      • 2014-12-09
      • 1970-01-01
      • 2018-07-12
      • 2020-05-22
      • 2017-02-03
      • 2021-10-31
      • 1970-01-01
      相关资源
      最近更新 更多