Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # Deletes all credentials from the Windows Credentials Manager
  2. # on Win7 and Win10 for domain debugging purposes.
  3.  
  4. # To allow powershell scripts in Windows enter in command line: Set-ExecutionPolicy Unrestricted
  5.  
  6. # 2019-05
  7.  
  8. $confirmation = Read-Host "Delete all credentials from windows credentials manager? [y/n]"
  9.  
  10. if ($confirmation -eq 'y') {
  11. $Credentials = (cmdkey /list | Where-Object {$_ -like "*Target=*"})
  12. Foreach ($Target in $Credentials) {
  13. $Target = ($Target -split (":", 2) | Select-Object -Skip 1).substring(1)
  14. $Argument = "/delete:" + $Target
  15. Start-Process Cmdkey -ArgumentList $Argument -NoNewWindow -RedirectStandardOutput $False
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement