1

I am enabling windows node for ansible. For this I am enabling http and https remote session in windows 7 using below command.

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))"

I am getting the below error in office.

Could you please help me on this?

At home in another laptop it is working fine.

+     Throw "Unable to establish an HTTP or HTTPS remoting session."
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to estab...moting session.:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to establish an HTTP or HTTPS remoting session.

I tried with below options:

set http_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/
set https_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/

set http_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/
set https_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/

set HTTP_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/
set HTTPS_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/

set HTTP_PROXY=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/
set HTTPS_PROXY=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/ 

i tried with all above details ...stil not working

Update:

Seems, connection created(Logged in). I observed below event log in windows machine

The WinRM service has received an unsecure HTTP connection from hostname. 

 This is not a secure configuration. 

 User Action 
 Set AllowUnencrypted to False in WinRM configuration to ensure packets are encrypted on the wire.

Thanks in advance.

sri
  • 131
  • 1
  • 3
  • 10

1 Answers1

1

You could be behind a proxy. If so try setting your proxy first:

set http_proxy=IP:Port
set https_proxy=IP:Port

Or you can goto your Control Panel->Internet Options->Connections->LAN Settings->Proxy servers.

All together:

set http_proxy=IP:Port
set https_proxy=IP:Port

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))"
Gamma.X
  • 554
  • 4
  • 9
  • set http_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/ set https_proxy=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/ set http_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/ set https_proxy=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/ set HTTP_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/ set HTTPS_PROXY=http://lsl5kor:N@llapat12@jk-proxy-apac.india.com:8080/ set HTTP_PROXY=http://lsl5kor:N%40llapat12@jk-proxy-apac.india.com:8080/ i tried with all above details ...still not working – sri Nov 07 '17 at 09:56
  • U can try proxifier, https://www.proxifier.com/download.htm. set it up to point to you proxy. And it will take care of the rest for you. – Gamma.X Nov 07 '17 at 11:08
  • seems no issue with proxy..test passed in proxifier – sri Nov 07 '17 at 11:43
  • but did you see your calls go through it? – Gamma.X Nov 07 '17 at 12:18
  • Yes ..i am able to see powershell connections – sri Nov 07 '17 at 12:48
  • Cool then, did it send and recieve data? what error are you getting? – Gamma.X Nov 07 '17 at 13:55
  • not getting any error. it sending and receiving data – sri Nov 07 '17 at 14:01