Error Message: “Cannot connect under a different Name”
Once you are connected with the wrong credentials, there is no means to reverse the situation other than
to close all Explorer windows, and perhaps reboot.
net use \\SAMBA-SERVER\sharename /user:root
gives you an error message:
“Multiple connections to a server or a shared resource by the same user utilizing
several user names are not allowed. Disconnect all previous connections to the server,
esp. the shared resource, and try again.”
Every attempt to “connect a network drive” to
z: is countered by the pertinacious message: “This
network folder is currently connected under different credentials (username and password).
Disconnect first any existing connection to this network share in order to connect again under
a different username and password”.
So you close all connections. You try again. You get the same message. You check from the Samba side, using
. Yes, there are more connections. You kill them all. The client still gives you
the same error message. You watch the smbd.log file on a high debug level and try reconnect. Same error
message, but not a single line in the log. You start to wonder if there was a connection attempt at all. You
run ethereal and tcpdump while you try to connect. Result: not a single byte goes on the wire. Windows still
gives the error message. You close all Explorer windows and start it again. You try to connect and
this times it works! Windows seems to cache connection information somewhere and does not keep it up to date
(if you are unlucky, you might need to reboot to get rid of the error message).
The easiest way to forcefully terminate all connections from your client to a server is by executing:
C:\> net use * /delete
This will also disconnect all mapped drives and will allow you create fresh connection as required.