SHARE
TWEET

Untitled

a guest Jun 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top