My local machine exists on a domain in a separate forest from the forest I administer. As a result, I use PSSessions extensively. While I have been able to encrypt my credentials and save them in my profile on my local machine, I have tried to encrypt my credentials and save them in my profile on the remote machine and use them once I am inside of a PowerShell Session. Below is an example:
PS C:\WINDOWS\system32> etsn -computer 192.168.1.2 -cr $mycred
[192.168.1.2]: PS C:\Users\challer\Documents> get-aduser -server dc01.domain.local -filter * -cr $mycred
After entering this command, I receive the following pop-up:
"Warning: A script or application on the remote computer 192.168.1.2 is requesting your credentials. Enter your credentials only if you trust the remote computer and the application or script that is requesting them."
Can a credential be encrypted, saved, stored on a remote server and accessed from within a PSSession? Or can an encrypted credential that is stored locally be passed through to a PSSession?