Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Windows seems to be saving my credentials for a variety of applications (terminal servers, etc) and I'd like to purge this data.

How can I backup and purge this data?

share|improve this question
Is there a way to automate the removal of cached credentials via a PowerShell script that I can invoke? – user87602 Sep 24 '15 at 20:05
up vote 37 down vote accepted

The utility to delete cached credentials is hard to find. It stores both certificate data and also user passwords.

Open a command prompt, or enter the following in the run command

 rundll32.exe keymgr.dll,KRShowKeyMgr

Image of cached credentials

Windows 7 makes this easier by creating an icon in the control panel called "Credential manager"

enter image description here

share|improve this answer
good write up for both Admins and End-Users. Could have used a route guide to the Credential Manager, for those less-Admin knowledgeable. – GoldBishop Aug 28 '14 at 17:18
Excellent. This command saved my day. Didn't know about it – alfredocambera Sep 10 '14 at 18:29

FYI, I just encountered a case where a credential (possibly corrupt, since it showed up under an entry named with only two, odd Unicode characters) appeared only in the rundll32.exe keymgr.dll,KRShowKeyMgr interface, and not in the Credential Manager interface found in the Windows 7 control panel. So it may be worth checking both interfaces for cached credentials.

share|improve this answer

There is also a command-line utility:

C:\> cmdkey /?

Creates, displays, and deletes stored user names and passwords.

The syntax of this command is:

CMDKEY [{/add | /generic}:targetname {/smartcard | /user:username {/pass{:password}}} | /delete{:targetname | /ras} | /list{:targetname}]


  To list available credentials:
     cmdkey /list
     cmdkey /list:targetname

  To create domain credentials:
     cmdkey /add:targetname /user:username /pass:password
     cmdkey /add:targetname /user:username /pass
     cmdkey /add:targetname /user:username
     cmdkey /add:targetname /smartcard

  To create generic credentials:
     The /add switch may be replaced by /generic to create generic credentials

  To delete existing credentials:
     cmdkey /delete:targetname

  To delete RAS credentials:
     cmdkey /delete /ras
share|improve this answer

Use cmd:


(to see what you're connected to)


(to delete all connections)

net use info is not the same info as listed in keymgr or credential mgr.

share|improve this answer
In a way this is also true. I was thinking of cached profiles after reboots. – LamonteCristo Jun 8 at 23:43

protected by Jeff Ferland Jun 8 at 23:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.