windows setup for winrm, for Ansible

In order for Ansible to connect to your windows server, you need to open winrm,you can do it by putting the settings inn a ps1 (/var/www/html/w.ps1) file in your webserver with these contents:

Enable-PSRemoting
Set-Item -Path “WSMan:\localhost\Service\Auth\Basic” -value True
Set-Item -Path “WSMan:\localhost\Service\AllowUnencrypted” -value True
net localgroup “Remote Management Users” my_admin /add
net localgroup administrators my_admin /add

Then in the windows server, you can get it and run it using:
powershell “IEX(New-Object Net.WebClient).downloadString(‘http://10.4.192.192/w.ps1’)”