2

I have a list of machines that a need to create a PsSession object for. Some of the machines require my default credentials, while others need a customized credential object.

How do get a reference to the default credential object used in the PS commands when you do not provide the -credential argument? I would like the following commands to perform the same result.

new-pssession $SERVER
new-pssession $SERVER -credential $DEFAULT
cmcginty
  • 113,384
  • 42
  • 163
  • 163

1 Answers1

0

You can't simply grab the current user's credentials and store them in an object, the API won't let you. See Get current user's credentials object in Powershell without prompting

Community
  • 1
  • 1
Bill Dinger
  • 179
  • 1
  • 6