Skip to content

Instantly share code, notes, and snippets.

@n0bodysec
Last active July 25, 2024 04:26
Show Gist options
  • Save n0bodysec/69aafc0c8b71354e5f726ea9887f6654 to your computer and use it in GitHub Desktop.
Save n0bodysec/69aafc0c8b71354e5f726ea9887f6654 to your computer and use it in GitHub Desktop.
Clear all Adobe App credentials from Windows Credential Manager
# Inspired on https://community.adobe.com/t5/download-install-discussions/getting-a-long-list-of-quot-adobe-app-info-quot-generic-credentials/td-p/10189222
# Usage: add this script to your PowerShell profile and run "ClearAdobeCredentials". "Adobe User" credentials will not be removed.
<# Commands explanation:
cmdkey /list > This will list all your saved credentials
Select-String -Pattern "Adobe App" > Show only credentials that match "Adobe App"
-replace "^ *[A-Za-z]+:? (.*)", "`"`$1`"") > Regex that removes " Target:" and add quotes around the credential
% { cmdkey /delete:$_ } > This will run "cmdkey /delete" for each matching credential
#>
function ClearAdobeCredentials { ((cmdkey /list | Select-String -Pattern "Adobe App") -replace "^ *[A-Za-z]+:? (.*)", "`"`$1`"") | % { cmdkey /delete:$_ } }
@BryantAvey
Copy link

This works so great. I really appreciate you putting this together.
For those who aren't familiar with PowerShell here's how you implement this so it'll work:

  1. Open PowerShell from the start menu
  2. At the PowerShell Command prompt type: "notepad $profile" without the quote marks.
  3. This will launch notepad and most likely an empty .ps1 file called Microsoft.PowerShell_profile.ps1. (Note you may be prompted to create the profile file - choose yes)
  4. copy/paste in the function from the provided source code above (lines 12 and 13 starting with "function" - or just copy the whole thing and paste it into your Microsoft.PowerShell_profile.ps1 file.
  5. Save the file
  6. Exit PowerShell and relaunch PowerShell
  7. At the prompt type "ClearAdobeCredentials" without quotes. This will execute the function
  8. You should start seeing "CMDKEY: Credential deleted successfully." messages scroll by

Thanks again for writing this bit of code - it saves me so much time and hassle from having to manually delete these so things will run.

@n0bodysec
Copy link
Author

You are welcome! I'm glad to hear that it is useful for someone.

@Atha1Kishan
Copy link

I have tried using the following, and it worked for me.

  1. Open Powershell and run the following commands
    • The following will remove Adobe credentials
      cmdkey /list | Select-String "Adobe" -SimpleMatch | ForEach-Object { cmdkey /delete:($_ -replace "^.+?Target: ","") }

    • The Following will remove Microsoft credentials
      cmdkey /list | Select-String "Microsoft" -SimpleMatch | ForEach-Object { cmdkey /delete:($_ -replace "^.+?Target: ","") }

@n0bodysec
Copy link
Author

Hello @Atha1Kishan.

The problem with your method is that “Target:” would only match if your OS is set to English. For example, in Spanish the word is "Destino".

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