I want to be able to add multiple entries to my Windows Credentials Vault using PowerShell.
I searched a bit and came across this code:
[Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
$vault = New-Object Windows.Security.Credentials.PasswordVault
$cred = New-Object windows.Security.Credentials.PasswordCredential
$cred.Resource = 'My Credentials'
$cred.UserName = 'MyDomain\MyUserName'
$cred.Password = 'MyPassword'
$vault.Add($cred)
Remove-Variable cred # So that we don't have the password lingering in memory!
The problem is that the new entry is stored in the Web Credential Vault and not in the Windows Credentials Vault. I must be missing something. How can I fix it?
PS: I know there are better ways to store the password, but that not what's important here. Let’s just focus on the vault please. :)
Continuing from my comment, look at these tools:
Also, look at this: Secrets Management Development Release
Or just old school: