2

I'm trying to do the following tasks:

  • Connect to a remote computer through Powershell ISE 4
  • Then run a ps1 script in that computer, that installs chocolatey and update other software

This machine is set to the corporate proxy server which is very sassy when I try to authenticate. Since I have a Squid in a lab environment connected to our DMZ, I wanted to use this proxy while I install stuff on this PC. No authentication required. :-)

  • I could set my Squid proxy on this remote machine via Powershell
  • Tried to run my .ps1 script to install chocolatey and get error message:

"The remote server returned an error: (407) Proxy Authentication Required."

This driving me nuts. I'm sure I'm missing something here, since I really believe that as long as I have changed the proxy that doesn't need authentication, I was good to go. I have checked this pc graphically and the Squid proxy is all set there.

Can you please give some hint on what I'm screwing up?

SarsaJP
  • 23
  • 5

1 Answers1

0

There is a workaround:

  1. You login with some credentials to your server (ideally a service account)
  2. You configure proxy in the server (Not sure if machine.config or internet explorer settings)
  3. You can execute remote command (Invoke-Command) using -Credential parameter, using that service account. The Powershell command will have those credentials
Oscar Foley
  • 332
  • 5
  • 18