以非管理员身份远程处理 Powershell

joo*_*oon 4 ssh powershell windows-8

我正在使用ssh登录到其他 Windows 机器。我正在尝试pssessionlocalhost. 但我不能在正常的豪华提示下做到这一点:

$ New-PSSession
New-PSSession : [localhost] Connecting to remote server localhost failed with the
following error message : Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession
+ ~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspa
   ce) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
Run Code Online (Sandbox Code Playgroud)

看来我必须在一个高架的豪华外壳上。没有管理员权限,有没有办法做到这一点?

Ant*_*ace 9

Powershell Remoting 有一个默认的PSSessionConfigurationMicrosoft.PowerShell,它使用SDDL调用,它只允许具有管理权限的人在该机器上执行远程命令。

您需要与管理员联系并让他们为您打开:

PS C:\> Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI
Run Code Online (Sandbox Code Playgroud)

更多信息:http : //blogs.msdn.com/b/powershell/archive/2009/11/23/you-don-t-have-to-be-an-administrator-to-run-remote-powershell-命令.aspx

不要忘记启用 PSRemoting并打开相应的端口 (5985 HTTP/5986 HTTPS)。