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
How to reproduce:
1: On the remote machine, store credentials via
New-StoredCredential -Username <username> -Password <password> -Target <target> -Persist LocalMachine2: 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.
Actual results
Error message: