Powershell New-SmbMapping驱动器只能从Powershell访问 [英] Powershell New-SmbMapping drives only accessible from Powershell
问题描述
根据我的理解, New-SmbMapping W:-RemotePath \\myserver\myfolder
应该做同样的事情 net use w:\\myserver\myfolder
。但是,如果我使用 net
,我可以很容易地从Windows资源管理器访问映射的驱动器。另一方面,如果我使用 New-SmbMapping
,它显示如果我运行 Get-SmbMapping
可以使用 start W:
命令访问它,但它不会显示在我的电脑,如果我键入W:进入Windows资源管理器栏中Windows抱怨无法找到文件位置。这里有什么问题?
As I understand it, New-SmbMapping W: -RemotePath \\myserver\myfolder
should do the same thing as net use w: \\myserver\myfolder
. However, if I use net
I am easily able to access the mapped drive from the Windows Explorer. On the other hand, if I use New-SmbMapping
, it shows up if I run Get-SmbMapping
, and I can access it with the start W:
command, but it doesn't show up in My Computer and if I type W: into the Windows Explorer bar Windows complains about being unable to find the file location. What's wrong here?
推荐答案
我不熟悉 New-SmbMaping
但在PowerShell 3.0中,您可以使用New-PSdrive和-Persist开关映射驱动器。删除psdrive以从映射的网络驱动器断开连接。
I'm not familiar with New-SmbMaping
but in PowerShell 3.0 you can use the New-PSdrive and the -Persist switch to map a drive. Remoce the psdrive to disconnect from the mapped network drive.
New-PSDrive -Name W -Root \\myserver\myfolder -Persist -PSProvider FileSystem
这篇关于Powershell New-SmbMapping驱动器只能从Powershell访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!