PowerShell_Credential_Manager icon indicating copy to clipboard operation
PowerShell_Credential_Manager copied to clipboard

Attempting to remotely use stored credentials results in 1312 error

Open AaronTilton opened this issue 1 year ago • 0 comments

How to reproduce:

1: On the remote machine, store credentials via New-StoredCredential -Username <username> -Password <password> -Target <target> -Persist LocalMachine 2: On the remote machine, create a script that accesses the credentials i.e., `Get-StoredCredential -target | Out-File -FilePath 3: On the local machine, attempt to execute the script on the remote machine via scheduled task, etc.

Expected results

The script can access the credentials and store the output of the Get-StoredCredential command i.e.

UserName                        Password
--------                        --------
<username>@<domain>             System.Security.SecureString

Actual results

Error message:

CredRead failed with the error code 1312.
    + CategoryInfo          : InvalidOperation: (SCC:String) [Get-StoredCredential], Exception
    + FullyQualifiedErrorId : 1,PSCredentialManager.Cmdlet.GetStoredCredential
WARNING: Unable to convert Credential object without username or password to PSCredential object

AaronTilton avatar Jan 10 '24 16:01 AaronTilton