Skip to content

Instantly share code, notes, and snippets.

@janikvonrotz
Created December 6, 2013 07:39
Show Gist options
  • Save janikvonrotz/7819990 to your computer and use it in GitHub Desktop.
Save janikvonrotz/7819990 to your computer and use it in GitHub Desktop.
PowerShell: Delete all cmdkey credentials #PowerShell #Windows
cmdkey /list | ForEach-Object{if($_ -like "*Ziel:*"){cmdkey /del:($_ -replace " ","" -replace "Ziel:","")}}
@lucapiccio
Copy link

lucapiccio commented Mar 18, 2024

For me all your listing depends from windows language version.

If you want to delete all key ignoring the lang of windows you can do:

cmdkey /list | ForEach-Object{
    if($_ -like "*=*"){
        $c = ($_ -replace (' ')).split(":", 2)[1]
        cmdkey.exe /delete $c | Out-Null
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment