Im doing a script in powershell to re-add user credentials remotely when they loose access to some network drives/shared folders that need access with these credentials.I have no problem adding/deleting a credential.But i want to know which credentials does the user have stored before modifying them, and i dont find where does the credential manager store the data. I searched on the registry with the keywords ControlPanel and CredentialManager to see if there was a key that stored them but no luck.
#Deleting cred
$servidor = "X.X.X.X"
cmdkey /delete:$servidor
#Adding cred
$servidor = "X.X.X.X"
$usu = Read-Host "Dime el usuario a agregar"
$pass = Read-host "Dime la contraseña" | ConvertTo-SecureString -AsPlainText -Force
cmdkey /add:$servidor /user:$usu /pass:$pass
The credential manager image to add more clarity to the question.
