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