从源计算机授予PowerShell访问目标系统时出错 [英] Error while giving powershell access to target system from source machine

查看:153
本文介绍了从源计算机授予PowerShell访问目标系统时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Powershell极客,



我基本上是一个C#人,但我的要求是让Powershell从我的系统访问远程/目标系统(Say Client) (说服务器)。我是这些远程/目标计算机中管理员组的成员。此外,包括我在内的所有系统都属于同一个域。



我尝试过:



我尝试在我的系统中运行这些命令(服务器) -



>启用-PSRemoting -Force



> Invoke-Command -ComputerName client01,client02 -ScriptBlock {SET -executionPolicy ExecutionPolicy Unrestricted}




我收到以下错误消息 -

连接到远程服务器client01时,client02失败并显示以下错误消息:客户端无法连接到请求中指定的目标。验证在目标上运行的服务以分析和配置WinRM服务。

Hello Powershell geeks,

I am basically a C# guy but my requirement is to give Powershell access to the remote/target systems (Say Client) from my system (Say Server). I am part of the administrator group in those remote/target machines. Also, all the systems including mine are in the same domain.

What I have tried:

I tried running these commands in my system (Server)-

> Enable-PSRemoting -Force

> Invoke-Command -ComputerName client01,client02 -ScriptBlock { SET -executionPolicy ExecutionPolicy Unrestricted }


I get following error message-
Connecting to remote server client01,client02 failed with following error message: The Client cannot connect to the destination specified in the request. Verify that the service running on the destination to analyze and configure the WinRM service.

推荐答案

输入的系统Invoke-Command -ComputerName 是一个客户端,并且作为参数传递的远程系统是这里的服务器。



所以你必须执行启用-PSRemoting 在远程系统而非你的系统上:

The system where you enter Invoke-Command -ComputerName is a client and the remote systems passed as arguments are servers here.

So you have to execute Enable-PSRemoting on the remote systems and not on yours:

您必须在将接收命令的每台计算机上只运行一次此命令。您不必在仅发送命令的计算机上运行它。因为配置启动了侦听器,所以只在需要的地方运行它是明智的。

You have to run this command only one time on each computer that will receive commands. You do not have to run it on computers that only send commands. Because the configuration starts listeners, it is prudent to run it only where it is needed.


这篇关于从源计算机授予PowerShell访问目标系统时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆