【发布时间】:2013-06-21 14:47:07
【问题描述】:
我正在从我的桌面上使用远程计算机,并且我有以下脚本:
Invoke-Command -computername $name -authentification default -凭据 $creds1 -scriptblock {net use \share $password2 /user:otherdomain\otheruser}
然后我得到一个指定的登录会话不存在。它可能已经被终止。这件事令人沮丧,因为如果我直接在远程机器上运行net use \\share $password2 /user:otherdomain\otheruser,它就可以完美运行。有解决方法还是我错过了什么?
【问题讨论】:
-
我通过将 net session 添加到我的远程脚本中发现没有条目。有人知道如何手动添加吗?
标签: powershell mapping net-use