Situation: When attempting to add licensing server in Windows 2012 R2 RS service, you may get this message: Unable to connect to the server by using Windows Powershell Remoting.
Troubleshooting:
We fix the problem. It is Environment Variables. Search online, we find some people have the similar case. Changing the path from %systemroot% to c:\windows and that fixed the problem.
In our case, chaging from PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Millennium 3;C:\Program Files (x86)\Microsoft Office\Office16;C:\Bat;
to
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Millennium 3;C:\Program Files (x86)\Microsoft Office\Office16;C:\Bat;
Note: without PATH= fixes the problem.
Other troubleshooting:
1. Disable IPv6 for a test.
2. Run Powershell, run this command: Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000
Then restart the server.
In a PS Shell
3. It could be the firewall issue. disable the Windows firewall or add ‘Windows Remote Management’ rule to my firewall.
4. clearing the proxy by running this command: netsh winhttp reset proxy
5. Compatibility problem when installing Remote desktop services role on 2012 “Unable to connect to the server by using Windows Powershell Remoting”
6. “Enable-PSRemoting -force” worked for me.
7. Solved the issue – DC and RDS server had 3 hour time difference. Syncing time worked.
8. If you want to add TS licensing service, add Server role. If you want to add this server under RDS licensing server to receive the RD CALs, go to Deployment.
9. had same issue fixed it by clearing the proxy
netsh winhttp reset proxy
worked for me
10. Domain admin can’t seem to do anything so added another admin account (with local admin rights) then running the RDS Deployment from an elevated Server Manager session did the trick for me.
11. The solution was to increase the MaxFieldLength and MaxRequestBytes keys in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters
If the keys does not exists you can create them, be sure to use the DWORD type.
I sat MaxFieldLength to DEC value 40000 and MaxRequestBytes to DEC value 32768 and rebooted the server. Problem solved.
12. Solved the issue – DC and RDS server had 3 hour time difference. Syncing time worked.
13. My systems engineer found that my issue was caused by a System variable that was set incorrectly. The Path variable had been cleared, which was keeping Powershell Remoting from working correctly. He copied the variables from another server, and it is nowworking correctly.
14. If there is a GPO setting on the network that affects the server you are trying to install RDS on and that GPO controls WinRM listening ports and is incorrectly configured then you will get this error.
Run winrm enumerate winrm/config/listener on the target server and if ListeningOn = null is returned then check GPO on this box with gpresult /h result.html & result.html. Search this GPO output for Windows Components/Windows RemoteManagement (WinRM)/WinRM Service and IPv4 Filter and IPv6 Filter need to contain * or an IP range that includes this server. If the value is blank or wrong IP range then you will get the original posters error message!
15. In Server Manager/Remote Management was already enabled. My fix was to disable and then re-enable Remote Management. I was then able to reinstall RDS.
16. use “net time /domain:*** /set” and problem fixed.