Phantom Mapped Network Drive Letter From Windows To Linux
Asked Answered
C

2

6

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.

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

delete all mapped drives:

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

Attempt to delete W: drive explicitly

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

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.
Carbonaceous answered 13/11, 2012 at 22:56 Comment(0)
W
7

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:

psexec -s -i cmd
net use W: /delete
Wait answered 19/6, 2017 at 14:52 Comment(2)
This was the reason in my case.Frenum
Thank you for the response. I just noted this and I think you're absolutely correct. I will mark this as the right answer. I cannot test this as the question was from 6 years ago, but I'm sure it will come up again for others and possibly myself. Thank you for the reply!!Carbonaceous
S
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.

If that doesn't work try using just

net use /persistent:no

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

Sailboat answered 12/12, 2012 at 15:51 Comment(1)
Thanks Cyph3r I appreciate the response but sadly I want to resolve this issue without a reboot! I'm concerned if this were to occur in production a reboot would not be an option. I did try what you mentioned without a reboot and no go. It seems like it sees the mapped drive on 1 layer but not on another.Carbonaceous

© 2022 - 2024 — McMap. All rights reserved.