Resolving “HTTP 403” Errors in PowerShell Remoting If you use PowerShell remoting and get “HTTP 403” errors, one of the more obscure reasons for this...
Resolving “HTTP 403” Errors in PowerShell Remoting
If you use PowerShell remoting and get “HTTP 403” errors, one of the more obscure reasons for this is a proxy that interferes with your request.
Excluding the Proxy to Fix the Issue
It’s easy to exclude the proxy, though. Simply add a session option to your call and set the ProxyAccessType to “NoProxyServer”:
# you are connecting to this computer
# the computer in $destinationcomputer needs to have
# PowerShell remoting enabled
$DestinationComputer='server12'$option=New-PSSessionOption-ProxyAccessTypeNoProxyServerInvoke-Command-ScriptBlock { "Connected to $env:computername" } -ComputerName$DestinationComputer-SessionOption$option