0

当我可以通过简单地输入远程会话时,我有服务器(使用Microsoft Windows Server 2003 R2 SE ;手动安装 WinRM):

输入-PSSession *computername_here*

或(在远程会话之外)调用远程命令:

Get-Process -ComputerName *computername_here*

不幸的是,在另一个(使用Microsoft Windows Server 2008 R2 SE)上它不起作用(尽管我使用相同的配置)。我需要输入(根据第一个示例):

输入-PSSession IP address-Credential "域\用户名"

然后给出用户名和密码。我知道可以将凭据保存到外部文件,但我不想像连接第一台服务器那样简单地连接到远程服务器?我应该检查防火墙还是以特殊方式配置我的服务器?

==================================================== =================

谢谢你的答案。我说的是“Microsoft Windows Server 2008 R2 Standard”操作系统
(“*gwmi win32_operatingsystem |select name*”命令告诉我)。

WSManConfig:Microsoft.WSMan.Management\WSMan::localhost\Client

包含属性TrustedHosts设置为 *,所以我认为它是正确的。

有趣的是,虽然我在两台机器上都有管理员权限,但是当我尝试检查“localhost”包含的内容时,我收到了一条错误消息,而不是直接从服务器,而是从我的本地计算机:

PS WSMan:\localhost> ls
访问被拒绝。+ CategoryInfo : + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetChildItemCommand

4

2 回答 2

0

要检查的是您当前的用户是否有权访问目标服务器,服务器是否与客户端在同一个域中?

您能否澄清一下您使用的是什么服务器?AFAIK Microsoft Windows Server 2008 R2 SE 不存在。是2008年还是2003年?

这可能与客户端的TrustedHosts设置Authentication有关。您可以这样设置: WinRM set winrm/config/client @{TrustedHosts="*"} 在此处阅读更多信息:http: //blogs.dirteam.com/blogs/sanderberkouwer/archive/2008/02/23/remotely-managing-your-server-core-using-winrm-a​​nd -winrs.aspx

于 2012-04-05T07:05:35.987 回答
0

我知道这是几年后的事了,但这有帮助吗?

#this is TEST computer IP
# $computer = "xxx.xxx.xxx.xxx"

# if(test-wsman $computer -ErrorAction SilentlyContinue){
    # Remoting is enabled, continue
    # Write-Host "remoting is enabled"
# } else {
    # Something is wrong. 
    # throw "remoting is not enabled"
# }
于 2017-05-05T21:06:07.180 回答