找不到Powershell Invoke-Command UNC路径

时间:2020-07-01 15:44:40

标签: powershell-remoting invoke-command

我使用此powershell命令,但在$ b中出现奇怪的错误

$b = Invoke-Command -ComputerName servername -ScriptBlock { & attrib 'UNC path to file' } -credential $Cre

$b 
Path not found - "that UNC string up to the folder containing that file, but not the file name"

但是,完整路径存在并且我的$ Cre是正确的。 $ Cre是在正确之前创建的。 从dos命令提示符psexec rexec使用相同的命令;使用这些凭据。

我阅读了所有其他类似问题,但是我认为这很容易解释/解决。 我想使用$Cre进行身份验证,并以$Cre的身份运行会话,但这是一个奇怪的错误。 该文件的确是UNC共享上的文件,可以从此作为UNC文件访问 Powershell提示中的计算机以及从$Cre的Powershell提示中输入...,但是远程处理失败。 线索是什么?

0 个答案:

没有答案
相关问题