Using Windows 2008 R2. On our server we get this error: "Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again." when trying to map a drive on the command line. However, there are no open Explorer windows to the remote computer, and nothing shows on the remote computer when I do a "net use".
Why does windows think something is connected when "net use" reports that there are no drives or folders open to it??
How can I force Win to stop thinking something is connected without restarting?
It appears that I get the error if I specify a username and password. If I just put in:
net use n: \\192.168.10.120\test
it works, but if I put in
net use n: \\192.168.10.120\test "<password>" /user:"<domain\username>"
it gives the error. Why would that be?
Even if you remove the shared folder via net use * /del
, on the server side there is still a connection up there.
In order to get around this problem which Microsoft created by design you should map the drive in a way to let windows think it's another share on another server. The simplest way to do that is to use DNS aliases or ip addresses.
In your case, if your first mapping uses the ip address like \\IP\Share
with your current credential, you should use something like \\ServerName\Share password /user:Domain\Username
this should create a new share with the new credentials.
Microsoft call this behavior by design .. i call it just stupid design.
In our network I have found that restarting the Workstation service on the client computer is able to resolve this problem. This has worked in cases where a reboot of the client would also fix the problem. But restarting the service is much quicker & easier [and may work when a reboot does not].
My impression is that the local Windows PC is caching some old information and this seems to clear it out.
For information on restarting a service, see this question. It boils down to running the following commands on a command line:
C:\> net stop workstation /y
C:\> net start workstation
Note - the /y
flag will force the service to stop even if this will interrupt existing connections. But otherwise it will prompt the user and wait. So this may be necessary for scripting.
Follow these steps:
- Select the
Start
button, then typecmd
. - Right-click the
Command Prompt
option, then chooseRun as administrator
. - Type
net use
, then pressEnter
. - Look for any drives listed that may be questionable. In many cases where this problem occurs, the drive may not be assigned a letter. You’ll want to remove that drive.
- From the Command Prompt, type
net use /delete \\servername\foldername
where the servername\foldername is the drive that you wish to delete.
net use \\<host> /delete
should work, but many times it does not.
net stop workstation
as @DaveInCaz offered works in such cases.
I have some why and hows I couldn't fit into a comment.
It's not enough to restart the Workstation service (e.g. from services.msc console)
The service probably needs to be disabled for some short period of time. If you do this restart from a script, might be better to add a 1 second delay.In cases when
net use \\<host> /delete
does not work because another program is still using that share, you can identify such program and remove the blocking handle without closing it. Use Sysinternals Process Explorer, press Ctrl+F for search and enter the name of host machine owning such share. Click on each result, program window behind search dialog jumps to found program's handle. Right click that handle and select Close Handle. (or just close such program if you can) This works only in regular cases where there really is a program blocking the share disconnect. Not in those weird cases when it's blocked for no reason.elevated account has it's own environment. This brings some unexpected behavior.
If you donet use
command in an elevated cmd/PS console, it will not affect which user will Windows Explorer use to access the share.
And also other way around, if you run a program from the share and the program will ask and get elevated access, that program will loose connection to that share and any files it might need to run. You need to runnet use
from elevated cmd/PS to create an elevated share connection to that share.Removing Recent folders from Quick Access in Windows Explorer (top of left panel) might help in certain cases.
If the Host you are connecting to offers different access levels based on user, and/or has a Guest user (anonymous) share access, this is a situation you might often run into.
When you access a share using your username, folder inside such share might get assigned to Quick Access panel as a Recent item. When you open Windows Explorer after restart, Recent items inside Quick Access will be checked and a connection will be made to the Host machine and will stay open in form of a MUP. If your share accepts both authorized and anonymous connections, just opening Windows Explorer will create anonymous connection and when you click on a share which needs authorization, you will not get credential dialog but an error.
来源:https://stackoverflow.com/questions/24933661/multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more