1

I am working on making a script to clear out all generic credentials in credential manager.

I have a user here who has several hundred generic credentials, deleting them by conventional means is going to be a royal pain. I have googled all over and all the answers are, write a bat file using CMDKEY. Well the problem is, CMDKEY says there are NO credentials found... which makes absolutely no sense when she has several hundred that are visible in credential manager. Is there something I am missing here? I also tried VaultCMD, and that found nothing as well. Is there another command or way to simply clear out the credential manager, a file perhaps stored somewhere that I can erase etc?

Only way I can get CMDKEY to show a generic credential is if I add it from CMDKEY such as cmdkey /generic:testnet /user:test /pass 123

It will display that entry and only that.

1 Answers1

0

Use command line net use * /delete 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}]

Examples:

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