# WINRM

**URL:** <https://forum.ansible.com/t/winrm/31085>\
**Category:** Ansible Project\
**Created:** [August 21, 2019, 9:16am UTC](https://forum.ansible.com/t/winrm/31085 "2019-08-21T09:16:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Manish\_Kumar](https://forum.ansible.com/u/Manish_Kumar)\
**Post date:** [August 21, 2019, 9:16am UTC](https://forum.ansible.com/t/winrm/31085/1 "2019-08-21T09:16:07Z")

</div>

Hi,

I am working on automation using ansible where in I need to connect to remote window server and install NT service . Please help me for the correct playbook as I have installed Winrm on window and connectivity is working from Linux -Ansible control server to window.

ansible]$ ansible all -i inventory.yml -m win\_ping  
172.31.82.137 | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}

I need playbook for window service install.

Thanks,  
Manish

---

<div class="post-metadata">

**Author:** ![Manish\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Manish\_Kumar](https://forum.ansible.com/u/Manish_Kumar)\
**Post date:** [August 21, 2019, 9:41am UTC](https://forum.ansible.com/t/winrm/31085/2 "2019-08-21T09:41:44Z")

</div>

I have tried below playbook but getting error :

ansible-playbook window.yml -i inventory.yml  
ERROR! the field ‘hosts’ is required but was not set

Playbook contents:

- name: test raw module  
hosts: windows----------------\> I think here is the problem . I tried with ip but same error as i don’t have domain name available in my personal account .  
tasks:
- name: run ipconfig  
win\_command: ipconfig  
register: ipconfig
- debug: var=ipconfig

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 21, 2019, 10:20am UTC](https://forum.ansible.com/t/winrm/31085/3 "2019-08-21T10:20:21Z")

</div>

Playbook looks ok, maybe something with spacing?
