主机名:srv1、srv2、srv3
在 srv2 上打开 powershell 时,我可以使用以下命令在 srv3 上成功挂载远程网络驱动器:
PS > hostname
srv2
PS > net use Z: \\srv3\c /user:Admin *
Type the password for \\srv3\c:
The command completed successfully.
但是,当 wmic 从 srv1 进入 srv2 并尝试执行相同命令时,出现错误:
PS > hostname
srv1
PS > enter-PSSession -ComputerName srv2 -Credential $cred
PS > hostname
srv2
PS > net use Z: \\srv3\c /user:Admin *
net : System error 86 has occurred.
+ CategoryInfo : NotSpecified: (System error 86 has occurred.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
The specified network password is not correct.
它不会提示我输入密码,而且我也不想以纯文本形式输入密码。