Created
December 6, 2013 07:39
-
-
Save janikvonrotz/7819990 to your computer and use it in GitHub Desktop.
PowerShell: Delete all cmdkey credentials
#PowerShell
#Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmdkey /list | ForEach-Object{if($_ -like "*Ziel:*"){cmdkey /del:($_ -replace " ","" -replace "Ziel:","")}} |
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
cmdkey /list | ForEach-Object {if($_ -like "*Target=*") {cmdkey /delete:($_ -replace " ","" -replace "^.*target=","")}}