Export Credential Manager to PowerShell

2.2/5 - (15 votes)

If you ever find yourself in a sticky wicket and need to extract usernames and passwords from Credential Manager (usually because you forgot them), you can use this handy-dandy little function from PowerShell:

function ExportCredMan
{
    # Dump local passwords from credential manager
    [void][Windows.Security.Credentials.PasswordVault, Windows.Security.Credentials, ContentType = WindowsRuntime]
    $vault = New-Object Windows.Security.Credentials.PasswordVault
    $allpass = $vault.RetrieveAll() | % { $_.RetrievePassword(); $_ }
    $Output = "CachedPass.csv"
    $allpass | Export-Csv -NoTypeInformation $env:TEMP\$Output
}

$TEMP\CachedPass.csv will contain all of the sites, usernames, and passwords stored in Credential Manager.

Cheers!