8

I want to be able to connect from Windows 7 Explorer to SMB shares on different systems, using different credentials at different times.

How do you make Explorer offer a prompt to use different credentials? It seems if it knows credentials for a network share path, it uses them.

Or the opposite -- if it knows some credentials for that server, but you select a share that those creds don't have privileges for, then Explorer just says "you do not have permission".

And "Disconnect Drive" doesn't seem to apply here -- for one thing, network drives don't show up on that list unless mapped. And if they are mapped you can disconnect them, but when you browse back to them... Explorer uses the credentials it's remembered and logs right in with no prompt.

[Edit to add more details]

  1. I can use net use to delete everything from the list it uses (so 'net use' shows empty)... but Explorer still logs right back on using the same credentials. In one case that puts an item back on the net use list, for another share it does not. Either way, still can't change to different credentials.

  2. Part of the confusion when trying different approaches is probably this: https://blogs.msdn.microsoft.com/oldnewthing/20110223-00/?p=11413 which describes that there's a disconnect grace period of ten minutes. So 'net use * /d' doesn't take effect immediately.

  3. The 'net use /PERSISTENT:NO' command seems like it relates to this issue. But I couldn't get it to have any impact.

  4. Something that DOES work is killing the Workstation service, and then restarting it. At that point, attempting in Explorer to browse to previously-connected shares results in Explorer putting up a user/pwd dialog. Yay. But what a blunt instrument to get there. I'll also record for others who stumble in here that, for me, attempting to stop Workstation would hang in the "Stopping" state. I later discovered this occurs if (a) some Explorer window is browsing a share, or (b) I happen to have VPN software running (in my case NetExtender).

  5. I found this: Disconnecting / logging out from Windows network share without restarting Workstation service , in which the OP and others go through much of the same thought process... to no avail.

  6. This too might relate in some way: http://www.gadgetgrill.com.au/2009/11/19/windows-7-fixing-the-mapped-drive-credentials-problem/

So, problem not really solved -- I want to be able to gracefully switch a share to different credentials without having to clobber the VPN all other connections.

gwideman
  • 603

4 Answers4

7

Go to the Credential manager in your control panel (in user accounts and family safety)

Click in Windows Credentials and Select the credentials, delete what you need

Try to login en yours SMBs shares (if you delete correctly the credentials, windows ask you for user & password) and dont forget to uncheck Remenber my credentials

Wendigo
  • 142
5

In windows command prompt you can use the following the list the remembered credentials:

net use

The output will be similar to:

New connections will be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
OK                     \\123.123.123.123\shared      Microsoft Windows Network
The command completed successfully.

Then you can use the following command to delete the credentials:

net use <path> /delete

For the example above it would be:

net use \\123.123.123.123\shared /delete

UPDATE: Remember to close the explorer window and open a new one after this

Caner
  • 206
  • 1
  • 4
  • 11
3

For anyone still having this problem, I discovered something that worked for me: When in the Credential Manager and it does not have a credential for your server, add one with a bogus login (but the correct address). This made the Add Network Location GUI prompt me for a new login. Hope this helps.

1

The net use /delete (run as administrator) does not make explorer forget, because it is the wrong user. If you use it without the run as administrator, it does the job, but you may need to close all explorer sessions first. I actually killed explorer using task manager.

You then may have to use task manager to start a new task - explorer - to get it back again. Then run the net use - for my example I use:

net use /delete \\nas

Where my server is just called NAS. Then, if I try connecting to it again, I get asked for my password. The purpose of this is to protect the network drive if my PC gets hacked. I don't want the hackers having access to my network drive.