Passing credentials

This is an expansion upon my last question, but since it’s unique enough I thought I’d make a new post for it.

There are three proxies. I have credential authority to access one of them. I am writing a script to test all three of them. I am passing credentials of an account that can access all three of them.

$Credential = (New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "USERNAME", ("PASSWORD" | ConvertTo-SecureString -AsPlainText -Force ))

I pass those credentials to an Invoke-Webrequest

(Invoke-WebRequest -Credential $Credential -Uri $Website -Proxy $Proxy -Method Head)

There are no errors.

I auto-fail on two of the three proxies with a bad credentials message. The one I get through is the one that my personal access works on. Our proxy is not showing that USERNAME has tried sending traffic through any of them. The proxies that I don’t have access to (and am thus not contacting) is showing that I am trying to send traffic through them.

Passing the credentials isn’t doing anything, and I don’t know why.

submitted by /u/ConwayK9781
[link] [comments]

Leave a Reply