首页 文章

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

提问于
浏览
2

我正在尝试连接到远程交换并运行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',因为它不存在..

NOTE:

  • 我的本地Powershell正在Windows 2008 SP2上运行 32 bits

  • 我的远程Exchange在Windows 2008 R2 SP1上运行 64 bits

QUESTIONS:

  • 如何解决此问题?

  • 这是因为Windows 64位上的注册表重定向器吗?

非常感谢你

1 回答

  • 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

相关问题