Our company policy dictates that users must have admin accounts separately from their usual user accounts. We can call them CONTOSO\johndoe and CONTOSO\a-johndoe. The computer is running Windows 10 Enterprise (version 1607) with PowerShell version 5.1.14393.
For testing purposes I'll open two PowerShell windows next to each other, the first just by clicking the PowerShell shortcut and a second one by right-clicking the shortcut, selecting "Run as administrator" and entering CONTOSO\a-johndoe when prompted for credentials.
Now on the normal PS window if I enter
Invoke-WebRequest -Uri www.google.com
it instantly returns
StatusCode : 200
StatusDescription : OK
as it should. On the admin PS window it returns the following after around 30 seconds:
Invoke-WebRequest: Unable to connect to the remote server
I'm unable to determine how the admin-elevated PS is unable to access the internet. So far I've discovered the following:
- I'm directly connected to internet, no proxies whatsoever in between
netsh winhttp show proxy
shows "Direct access (no proxy server)" on both PS windows- I've found no user-targeted GPOs that would cause this
- I tried creating a local admin account (to bypass possible GPOs) but the result was the same
Any ideas what I might've missed or what to test and how?
Best Answer
We're using a web proxy that requires authentication, and I find I have the same behaviour in Windows 10.
I have found this to be a workaround, in an elevated PowerShell window:
After this, I find that other web requests authenticate correctly.