幽灵映射网络驱动器从Windows到Linux。

时间:2023-01-26 21:57:26

I've been using robocopy and mapped network drives to copy backups across untrusted windows domains to a central location, then push them to a Ubuntu storage device and I'm running into a lot of anomolies. One that I am seeing right now is mapped network drives that do not seem to exist under any user context. These are all being executed as me personally, or 'run as admin', both have the same result.

我一直在使用robocopy和映射网络驱动器,将不受信任的windows域的备份复制到一个中心位置,然后将它们推送到一个Ubuntu存储设备上,我遇到了很多异常情况。我现在看到的一个是映射网络驱动器,在任何用户环境下都不存在。这些都是作为我个人执行的,或者“作为admin运行”,两者都有相同的结果。

Do note this does work in Powershell but not from CMD.

请注意,这确实在Powershell中工作,但不是来自CMD。

delete all mapped drives:

删除所有映射驱动器:

Z:\Scripts>net use * /delete
There are no entries in the list.

Attempt to delete W: drive explicitly

尝试删除W:驱动显式。

Z:\Scripts>net use w: /delete /y
The network connection could not be found.

More help is available by typing NET HELPMSG 2250.

Attempt to change directory to mapped drive, note logon failure

尝试更改目录到映射驱动器,注意登录失败。

Z:\Scripts>w:
Logon failure: unknown user name or bad password.

Attempt to delete again

再次尝试删除

Z:\Scripts>net use W: /delete /y
The network connection could not be found.

More help is available by typing NET HELPMSG 2250.

No connections show up

没有连接出现

Z:\Scripts>net use
New connections will not be remembered.

There are no entries in the list.

W: Drive Does Not Exist

W:驱动器不存在。

Z:\Scripts>net use W: /delete /Y
The network connection could not be found.

More help is available by typing NET HELPMSG 2250.

Attempt to map a drive to it

尝试将驱动器映射到它。

Z:\Scripts>NET use W: \\servername\sharename PASSWORD /user:domain\username
System error 85 has occurred.

The local device name is already in use.

2 个解决方案

#1


2  

Try rebooting the system so that you have no phantom drive and then map it again with

尝试重新启动系统,这样您就没有了幻像驱动器,然后再重新映射它。

net use W: \\servername\sharename pass /domain\username /persistent:yes 

so that it remembers your credentials and then see if the problem occurs again. I had a similar problem once where a phantom drive appeared after 1-2 maps/disconnects and this worked for me then.

这样它就会记住你的凭证,然后看问题是否再次出现。我曾经有过一个类似的问题,在1-2个地图/断开连接后出现了一个幽灵驱动器,这对我很有用。

If that doesn't work try using just

如果那不奏效,试着用。

net use /persistent:no

so that it remembers no connection at all and check again.

这样它就不会记得任何连接,然后再检查。

#2


1  

I found an answer here that helped me in the same situation. Basically if the network drive was created automatically by the system then it was done by user nt authority\system and it can't be deleted even by administrator. To delete it as nt authority\system one can use PsExec for example:

我在这里找到了一个帮助我的答案。基本上,如果网络驱动器是由系统自动创建的,那么它是由用户nt权限\系统完成的,即使是管理员也不能删除它。要把它删除为nt权限\系统,可以使用PsExec举例:

    psexec -s -i cmd
    net use W: /delete

#1


2  

Try rebooting the system so that you have no phantom drive and then map it again with

尝试重新启动系统,这样您就没有了幻像驱动器,然后再重新映射它。

net use W: \\servername\sharename pass /domain\username /persistent:yes 

so that it remembers your credentials and then see if the problem occurs again. I had a similar problem once where a phantom drive appeared after 1-2 maps/disconnects and this worked for me then.

这样它就会记住你的凭证,然后看问题是否再次出现。我曾经有过一个类似的问题,在1-2个地图/断开连接后出现了一个幽灵驱动器,这对我很有用。

If that doesn't work try using just

如果那不奏效,试着用。

net use /persistent:no

so that it remembers no connection at all and check again.

这样它就不会记得任何连接,然后再检查。

#2


1  

I found an answer here that helped me in the same situation. Basically if the network drive was created automatically by the system then it was done by user nt authority\system and it can't be deleted even by administrator. To delete it as nt authority\system one can use PsExec for example:

我在这里找到了一个帮助我的答案。基本上,如果网络驱动器是由系统自动创建的,那么它是由用户nt权限\系统完成的,即使是管理员也不能删除它。要把它删除为nt权限\系统,可以使用PsExec举例:

    psexec -s -i cmd
    net use W: /delete