Q. How can I selectively clear cached credentials from my Windows client?

John Savill

August 23, 2010

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Running


rundll32.exe keymgr.dll, KRShowKeyMgr

displays the Stored User Names and Passwords screen, which, as shown, lists all logon credentials for servers, web sites, and programs. It also allows you to clear certain entries using the Remote button.

You can also run


control userpasswords2

then select the Advanced tab then click Manage Passwords to open the Credential Manager, which also allows you to clear cached credentials.

The Windows domain cached credentials are actually stored under HKLM SECURITYCache as values NL$1 through NL$10 (possibly up to 25, depending on your configuration). You have to be running Regedit as Local System to see these, which I accomplished using PSEXEC from sysinternals.com:

psexec -i -d -s c:windowsregedit.exe

Do not delete these values nor modify them—you shouldn't alter anything under this key. If you're inclined to do so, the best option would be to export out the key, copy a value that's blank to one of the values that does have a value (as it has a cached credential in it), and delete the control value (NL$Control) from the registry export then save. You can now import the reg file as system to clear all cache entries at a later time. Below is an example file that could be imported as system and blank out all cached credentials.


Windows Registry Editor Version 5.00

 \[HKEY_LOCAL_MACHINESECURITYCache\]
 "NL$1"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$2"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$3"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$4"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$5"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$6"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$7"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$8"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$9"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "NL$10"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,01,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like