Export Credential Manager to PowerShell

Export Credential Manager to PowerShell

  •  
  •  
  •  
  •  
  •  
  •  

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!

Published by Aaron Guilmette

Helping companies conquer inferior technology since 1997. I spend my time developing and implementing technology solutions so people can spend less time with technology. Specialties: Active Directory and Exchange consulting and deployment, Virtualization, Disaster Recovery, Office 365, datacenter migration/consolidation, cheese.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.