PowerShell 2.0:在远程会话期间访问 Windows 共享 [英] PowerShell 2.0: Accessing Windows Shares during a Remote Session

查看:56
本文介绍了PowerShell 2.0:在远程会话期间访问 Windows 共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 PowerShell 远程会话中访问共享网络位置时遇到问题.

I am having trouble accessing a shared network location while within a PowerShell remote session.

在 PowerShell 提示符下,我输入一个新会话:

From the PowerShell prompt, I enter a new session:

Enter-PSSession server1

会话已正确创建和输入.然后我尝试列出共享的内容:

The session is properly created and entered. I then attempt to list the contents of the share:

dir \\server2\share1

响应是这个错误:

Get-ChildItem : Cannot find path '\\server2\share1' because it does not exist.

但是,如果我远程桌面进入 server1,启动 PowerShell,并执行相同的 dir 命令,内容会正确列出.

However, if I remote desktop into server1, bring up PowerShell, and execute the very same dir command, the contents are correctly listed.

我使用凭据尝试了各种方法,但这似乎无法解决问题.我还通过whoami"命令确认我在两个示例中具有相同的身份.

I've tried various things using credentials, but that doesn't seem to fix it. I've also confirmed via the "whoami" command that I have the same identity in both examples.

什么会导致这种情况?

推荐答案

如果你不能像上面提到的那样使用凭证委托,你可以使用 在远程会话中挂载(或仅如下进行身份验证)远程共享显式凭据,例如

If you can't use credential delegation as mentioned above, you can mount (or just authenticate as below) the remote share in the remote session using explicit credentials, e.g.

[server1] ps> net use \\server2\share * /user:username
(prompts for password)
[server1] ps> dir \\server2\share
(listing)

这个问题与powershell本身无关;您试图在远程会话中将本地凭据重播到第三个位置,并且违反了 NTLM双跳"限制.

This problem has nothing to do with powershell per-se; you are trying to replay your local credentials in a remote session to a third location and falling foul of the NTLM "double hop" limitation.

这篇关于PowerShell 2.0:在远程会话期间访问 Windows 共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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