小编joo*_*oon的帖子

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

我正在使用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)

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

ssh powershell windows-8

4
推荐指数
1
解决办法
8876
查看次数

PowerShell 远程身份验证

当我user以与服务器相同的身份登录时,我可以Enter-PSSession

> Enter-PSSession -ConnectionURI http://xxx.xx.xxx.xx:5985
Run Code Online (Sandbox Code Playgroud)

但是,当我以不同的用户身份(在同一台机器上)登录并尝试Enter-PSSession使用-Credential参数时:

> Enter-PSSession -ConnectionUri http://xxx.xx.xxx.xx:5985 -Credential user
Run Code Online (Sandbox Code Playgroud)

输入密码后,我得到:

Enter-PSSession : Connecting to remote server xxx.xx.xxx.xx failed with the
following error message : Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ConnectionUri http://xxx.xx.xxx.xx:5985 -Credential user
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (http://xxx.xx.xxx.xx:5985/:Uri
  ) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Run Code Online (Sandbox Code Playgroud)

powershell

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

powershell ×2

ssh ×1

windows-8 ×1