I had some trouble to connect via RDP to a SharePoint Server. When I tried to get access to that machine via PowerShell to restart the RDP service I received the following error.
Connecting to remote server xyz failed with the following error message : The WinRM client received an HTTP status code of 403 from the remove WS-Management service.
After some digging I found the following situation fits to my issue.
The workstation I was using was configured to use a http proxy. And it seems PowerShell has beef with that configuration.
How to fix this
First check if a proxy is configured for you.
netsh winhttp show proxy
This will show you any proxy configured for your machine. If this applies to you, then get rid of the proxy first:
netsh winhttp reset proxy
If this worked, you will see something like “DirectAccess (no proxyserver)” in the console.
Next try to connect to the machine via PS Remoting.
# Read the credentials via a popup window $usercredentials = Get-Credential Enter-PSSession -ComputerName mymachine.domain.tld -Credential $usercredentials
Your console prompt should now show you something like this.
[mymachine.domain.tld]: PS C:\Users\master.admin\Documents> _
Now you can do whatever your user is allowed to do on that machine.