sudo apt-get update
sudo apt-get install software-properties-common
sudo apt install ansible
sudo apt install python3-pip
sudo apt install python-pip
pip install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org oauthlib -vvv
pip3 --version
ansible --version
- Download Powershell file and excute it as Admin: Ansible for WinRM
Enable-PSRemoting -SkipNetworkProfileCheck -Force
winrm quickconfig
winrm set winrm/config/Client/auth '@{Basic = "true"}'
winrm set winrm/config/Service/auth '@{Basic = "true"}'
winrm set winrm/config/Client '@{AllowUnencrypted = "true"}'
winrm set winrm/config/Service '@{AllowUnencrypted = "true"}'
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '192.168.211.1,192.168.99.1,10.31.147.159,172.20.144.1'
netsh advfirewall firewall add rule name="WinRM-HTTPS" dir=in localport=5986 protocol=TCP action=allow
- Check windows Auth. status
Get-ChildItem WSMan:\localhost\Service\Auth
- Get windows (WinRM) configuration:
winrm get winrm/config
- provide user name and pwd for LOCAL ADMIN (in case you are in domain)
$Credential = Get-Credential user
test-wsman 127.0.0.1 -Authentication Basic -Credential $Credential
winrs -r:http://127.0.0.1:5985/wsman -u:LOCAL_USER_NAME -p:PASSWORD ipconfig
Sampel:
winrs -r:http://127.0.0.1:5985/wsman -u:.\admin -p:123456 ipconfig