# Ansible 'win\_shell' working on one server and giving error on another:

**URL:** <https://forum.ansible.com/t/ansible-win-shell-working-on-one-server-and-giving-error-on-another/27328>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 19, 2018, 12:56pm UTC](https://forum.ansible.com/t/ansible-win-shell-working-on-one-server-and-giving-error-on-another/27328 "2018-04-19T12:56:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinesh\_Vashisht](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Dinesh\_Vashisht](https://forum.ansible.com/u/Dinesh_Vashisht)\
**Post date:** [April 19, 2018, 12:56pm UTC](https://forum.ansible.com/t/ansible-win-shell-working-on-one-server-and-giving-error-on-another/27328/1 "2018-04-19T12:56:16Z")

</div>

Team,

Ansible ‘win\_shell’ working on one server and giving error on another:

**Success on ‘[mytest.mydomain.com](http://mytest.mydomain.com)’ with .Net framework 4.5 and PowerShell 4.**

[user@server1]# ansible -i /etc/ansible/hosts windows-servers -m win\_shell -a ‘dir’  
[mytest.mydomain.com](http://mytest.mydomain.com) | SUCCESS | rc=0 \>\>

Directory: C:\Users\Administrator.MYTESTDC1

Mode LastWriteTime Length Name

* * *

d-r-- 2/2/2018 5:11 AM Contacts  
d-r-- 2/28/2018 1:37 AM Desktop  
d-r-- 3/8/2018 3:45 AM Documents  
d-r-- 2/28/2018 1:36 AM Downloads  
d-r-- 2/2/2018 5:11 AM Favorites  
d-r-- 2/2/2018 5:11 AM Links  
d-r-- 2/2/2018 5:11 AM Music  
d-r-- 2/2/2018 5:11 AM Pictures  
d-r-- 2/2/2018 5:11 AM Saved Games  
d-r-- 2/2/2018 5:11 AM Searches  
d-r-- 2/2/2018 5:11 AM Videos

**Failure o\*\*\*\*n '[win01.itnetwork.com](http://win01.itnetwork.com)’ with .Net framework 4.5 and PowerShell 3. (other Ansible modules are working OK)**

[user@server1]# ansible -i /etc/ansible/hosts WIN01 -m win\_shell -a ‘dir’  
[win01.itnetwork.com](http://win01.itnetwork.com) | FAILED | rc=1 \>\>  
Thread failed to start.  
non-zero return code

**Ansible Server Version: 2.5.0**

**Please suggest what could be the reason of error and how it can be resolved?**

Thank you,  
Dinesh Vashisht

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [April 19, 2018, 11:13pm UTC](https://forum.ansible.com/t/ansible-win-shell-working-on-one-server-and-giving-error-on-another/27328/2 "2018-04-19T23:13:45Z")

</div>

If you have PowerShell 3.0 I would look to see if the WMF 3.0 hotfix KB2842230 is installed which fixes a memory issue on this version.

I’ve got a script to do this if you want to use that, otherwise you can manually install it yourself [https://github.com/jborean93/ansible-windows/blob/master/scripts/Install-WMF3Hotfix.ps1](https://github.com/jborean93/ansible-windows/blob/master/scripts/Install-WMF3Hotfix.ps1).

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Dinesh\_Vashisht](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Dinesh\_Vashisht](https://forum.ansible.com/u/Dinesh_Vashisht)\
**Post date:** [April 20, 2018, 1:26pm UTC](https://forum.ansible.com/t/ansible-win-shell-working-on-one-server-and-giving-error-on-another/27328/3 "2018-04-20T13:26:36Z")

</div>

Hello Jordan,

As advised, installing WMF 3.0 hotfix KB2842230 solved the problem.

Thank you,

Dinesh Vashisht
