如何通过Powershell和PSSessionConfiguration远程连接到Exchange服务器

时间:2014-07-13 21:41:35

标签: windows powershell registry powershell-remoting

我正在尝试连接远程交换并运行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位?

非常感谢

1 个答案:

答案 0 :(得分: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
&#13;
&#13;
&#13;

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

相关问题