How to delete cached temporarily credentials for a network share on a Windows machine without rebooting or logging off
Solution 1
NOT FOR WINDOWS 10 (I am answer for WINDOWS 7)
To delete all network authentication
C:\> net use * /d
To view current network connection
C:\> net use
IMPORTANT NOTE
I tested in Windows 7 SP1 64 Bits, 100% WORK
After run the command, you need to go to task manager delete the explorer.exe , then reopen the application again.
To open the application, go to RUN, enter explorer.exe
Now you are fully clear the connection information in the session.
Solution 2
I know this is old, but in case anyone reads this in the future....
The next time this occurs I have found the best way to get rid of the credentials is to open an elevated command prompt and type in:
net use \\server\share /delete
then type in:
klist purge
I tried it with both command individually and they do not work alone. You have to first remove the connection if it exists. Then remove the Kerberos authentication ticket from the machine. I had an incident like yours where the connection no longer existed but the Kerberos ticket had not expired yet, so when I went back in and had not logged off of the machine it would use my previously entered credentials. By purging the ticket it prompted for credentials again.
Solution 3
Go to the control panel -> User accounts -> click on your name -> to the left click on "credentials" (or manage your credentials). All the used network credentials will be there.
Solution 4
The following should do what you want.
C:\> net use \\server\share /d
C:\> net use \\server\ipc$ /d
Solution 5
I have managed to access the share using the domain name instead of the IP, but I am curios.
This is a sign of bad client side cache and usually relates with netbios.
Try to restart the below list of services and if need, kill explorer, start the task manager and start it again via the task manager file->run entry, as explorer may also be caching things from those services.
I don't know exactly what is the failing service on your side, so you can try this this list, one at time to see if it works:
-TCP/IP NetBIOS Helper (can even be off if you add your machines to the DNS/host file)
-Workstation <--- TRY THIS ONE FIRST
-computer browse
-net logon
-rpc service
if it works, report back what was the service, so others can try it directly
good luck
Related videos on Youtube
ralz
Updated on September 18, 2022Comments
-
ralz almost 2 years
This is more of a curiosity then a real problem, I am just to lazy to reboot or log off my laptop.
I have connected to a network share on a Windows server with domain credentials from a non-domain Windows 7 machine, I didn't mark the option to remember the password.
The share is let's say
\\10.10.10.10\folder
.I have changed the password for that domain account in the meantime, and now when I try to access that share I get the following error:
Logon failure: unknown user name or bad password
I have tried the following on the client side:
- deleting cached credentials in Credential Manager
- running
net use delete
- running
net session \\ip.of.the.server /delete
gives me "A session does not exist with that computer name." - running
net use \\10.10.10.10\folder /u:DOMAIN\USER password
gives me "The command completed successfully.", but I still get the same unknown user name or bad password when trying to access the share from Windows Explorer - mapping the share as a network drive from GUI, but then I get
The network folder specified is currently mapped using a different user name and password.
To connect using a different user name and password, first disconnect any existing mappings to this network share. - running
net use
to see connections, I get that there are no connections in the list - killing
explorer.exe
and starting it again.
I have tried the following on the server side:
- going to Computer Management > Shared folders > Sessions to kill the session with my username
- rebooting the server
I have managed to access the share using the domain name instead of the IP address, but I am curios.
Does anybody know any way how to delete the cached credentials in this case? Where are credentials cached when you don't mark the remember password option when accessing the share, they are not shown in Credential Manager and there is no mapping shown when you run net use.
-
kralyk over 11 yearsYou'd need to kill the session at the server side through computer management on the server itself unless I'm missing something in your question.
-
ralz over 11 yearsThe question is how to do this on a client side on the Win7 machine, when you don't have privileges on server to kill a session. I'm curios where are the credentials cached on a client side in this case
-
kralyk over 11 yearsYou've done what can be done from the client side. The only thing remaining is the cached session on the server side. If you don't have privileges on the server, then the question belongs on superuser.com and not SF. Short of rebooting, which you already specified.
-
ralz over 11 yearsI played a little with server side over the night, server side doesn't play any role in this caching, i tried going to sessions in computer management and even rebooting the server, like i side not really a problem more a curiosity, it seem that in cases like this you either have to switch from ip to domain name or vice versa, or rebooting or logging of the computer
-
kralyk over 11 yearsIf you've done "net use" by itself and nothing is in the list and you've done everything else mentioned I don't know why it would still persist...sorry.
-
Admin almost 11 yearsThis information is useful when I was having problem regarding changing of User Credentials. I find this tutorial is useful for such kind of Problems.
-
XP1 about 7 years@rocketsarefast and I have discovered another way to clear the network credentials. I have posted my answer in this thread: How do I remove login credentials for a network location in Win7?: https://serverfault.com/questions/213765/how-do-i-remove-login-credentials-for-a-network-location-in-win7/853860#853860
-
Ryan over 4 yearsFor what it's worth there is not a single answer on this page (including comments) that works for me. I can not get the darn explorer to prompt me for credentials. Why wouldn't Microsoft put something in the context menu to "open as" or something so you can change the user? This is something that drives me insane at work a lot. In my office with our user setup (military so I can't change it) this is something I have to do constantly.
-
ralz over 11 yearsI have said in the question that I tried using the Credential Manager, I didn't use the remeber password option, and it seems that in this case the credentials are not there
-
ralz over 11 yearsyes i tried net use \\share /u:domain\user and it would always gave me an error, the windows obviously sees the share as mapped but it is not showing it when i run net use, i get that there are no connections in list (see also the error i gui in the question)
-
Goez over 11 yearsbut have you specified the password also on the command line? like net use \\share /u:domain\user password? This can also be done. another option is net session \\ip.of.server /delete
-
ralz over 11 yearsYes i tried net use \\share /u:domain\user password, I get the command completed successfully, i got error before because i made a mistake in my share name, nevertheless even after i get the completed successfully I still get unkown user or bad password when i try to access the share by IP from windows explorer. net session gives me that there is no session with that computer name
-
the-wabbit over 11 yearsThis is likely to fix the asker's issue. However note that you are not deleting "cached credentials" but connection information in your session - you should update your answer to reduce possible confusion. Killing explorer.exe is rather necessary on newer Windows clients as it seems to hold connections / sessions to the server without them appearing in the "net use" list.
-
Shiro over 11 yearsThank for the correction. Yes, Windows 7 got this issue hold the connections / sessions. However, it also will auto remove it, but I am not sure the duration. The best way is just kill the explorer. Fast and easy.
-
Drew Chapin almost 11 years+1 Restarting the Workstation service was enough to resolve it for me.
-
Talespin_Kit over 10 yearsrestarting is a stupid solution.
-
higuita about 10 years@Talespin_Kit I agree that it is stupid, but welcome to windows! If you have a better option to clean windows client cache, feel free to post it here. :)
-
Marcos about 10 yearsThank you! Nowhere in the GUI did Windows 8 make this apparent. Restarting the lanmanworkstation and others in services.msc helped nothing, as neither did restarting smbd, mucking with smbpasswd, etc. on the Linux Samba server.
-
mikebabcock about 10 yearsNote that smbstatus on a Linux box will let you see which PIDs go with which users, and you can kill those specifically to disconnect them.
-
Jason over 9 yearsThanks, @druciferre. Workstation restart worked for me on a Windows Server 2012 R2 (i.e., Windows 8.1) install. The NET USE command (my old standby) of course did not.
-
Babblo over 9 years+1 for the tip about re-starting explorer.exe
-
MrEdmundo about 9 years"In windows server 2012, you might need to restart the Workstation service." - superuser.com/questions/774070/…
-
dhj almost 9 yearsThis! This should be the accepted answer. No rebooting or kludging around with killing processes in the task manager. Simple and effective.
-
elsadek over 8 years"IMPORTANT NOTE" part is the answer.
-
NateJ about 8 yearsI agree -- the Kerberos purge is an effective punch. Just be aware that it's a sledgehammer, i.e. you're killing all of your client's Kerb tickets, not just for that one particular server/share!
-
prot over 7 yearsYou can probably add also /y switch to skip answering the [Y/N] question.
-
Robert Noack almost 7 yearsThis is the only thing that worked for me.
-
Johu about 6 yearsOn Windows 8.1 does not work even if I restarted the explorer process. It still remembers the password.
-
Johu about 6 yearsThe combination of these two commands still does not work on Windows 8.1.
-
Shiro about 6 years@Johu this is not about remember password. It removes cached credentials. If you want to remove remember credentials. You should go to Control Panel -> Credentials Management -> Under Windows Credentials remove the record.
-
Johu about 6 years@Shiro, sure! What I meant by "remembers password" is that it still allows me to visit the share without asking the password again. I am fully aware of the Credentials Manager. Meanwhile I also learned, that instead of restarting explorer.exe in my case I had to wait for 2 minutes for windows to forget the login information.
-
Johu about 6 yearsMeanwhile I also learned, that instead of restarting
klist purge
in my case I had to wait for 2 minutes for windows to forget the login information. I wish there was an instant method. -
ruslaniv over 3 yearsThis does not work on Windows 10. All the network connections are still present and accessible in the windows explorer. There is no process called "exporer.exe', but there is "windows explorer.exe'. There are no records associated with network login credentials in the "Control panel' -> 'Manage your credentials' -> 'Windows Credentials'
-
mivk over 3 yearsYou can also do
net use * /delete
if you don't want to delete them individually -
Martin MaKr Kratochvíl over 3 yearsklist purge - works for me.
-
Shiro about 2 yearsI answer for Windows 7 not for Windows 10. In Windows 10 will be using at Control panel' -> 'Manage your credentials' -> 'Windows Credentials'. And you can
Restart
the 'Windows Explorer' easily in Task Manager.