PowerShell Remoting and HTTP 403 Error

by | October 21,2016

Table of Contents

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 -ProxyAccessType NoProxyServer

Invoke-Command -ScriptBlock { "Connected to $env:computername" } -ComputerName $DestinationComputer -SessionOption $option

Twitter This Tip! ReTweet this Tip!