# windows ansible powershell in 2.3.1

**URL:** <https://forum.ansible.com/t/windows-ansible-powershell-in-2-3-1/25646>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [September 29, 2017, 10:59pm UTC](https://forum.ansible.com/t/windows-ansible-powershell-in-2-3-1/25646 "2017-09-29T22:59:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anil](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@Anil](https://forum.ansible.com/u/Anil)\
**Post date:** [September 29, 2017, 10:59pm UTC](https://forum.ansible.com/t/windows-ansible-powershell-in-2-3-1/25646/1 "2017-09-29T22:59:57Z")

</div>

Hello Folks

I am seeing issues when try to run powershell script from ansible after upgrade from 2.2.1 to 2.3.1, any ideas, suggestions are appreciated?

[root@marx4150 playbooks]# ansible-playbook -i inventory AdIntRhel.yml --tags crtObj --extra-vars “vm\_name=testing123”

PLAY [win] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [script] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [mawx0001.abc.corp]: UNREACHABLE! =\> {“changed”: false, “msg”: “Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgAoAE4AZQB3AC0ASQB0AGUAbQAgAC0AVAB5AHAAZQAgAEQAaQByAGUAYwB0AG8AcgB5ACAALQBQAGEAdABoACAAJABlAG4AdgA6AHQAZQBtAHAAIAAtAE4AYQBtAGUAIAAiAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANQAwADYANwAyADQAMgA2ADEALgA2ADgALQAxADUANQA5ADcANgAxADgANgAxADgANwAyADYAMwAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwAKAEkAZgAgACgALQBuAG8AdAAgACQAPwApACAAewAgAEkAZgAgACgARwBlAHQALQBWAGEAcgBpAGEAYgBsAGUAIABMAEEAUwBUAEUAWABJAFQAQwBPAEQARQAgAC0ARQByAHIAbwByAEEAYwB0AGkAbwBuACAAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQApACAAewAgAGUAeABpAHQAIAAkAEwAQQBTAFQARQBYAEkAVABDAE8ARABFACAAfQAgAEUAbABzAGUAIAB7ACAAZQB4AGkAdAAgADEAIAB9ACAAfQA=, exited with result 1”, “unreachable”: true}  
to retry, use: --limit @/home/athangal/playbooks/AdIntRhel.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

mawx0001.abc.corp : ok=0 changed=0 unreachable=1 failed=0

[root@marx4150 playbooks]# ansible mawx0001.abc.corp -m win\_ping  
mawx0001.abc.corp | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}

[root@marx4150 playbooks]# cat AdIntRhel.yml

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 1, 2017, 7:43am UTC](https://forum.ansible.com/t/windows-ansible-powershell-in-2-3-1/25646/2 "2017-10-01T07:43:47Z")

</div>

Is the windows host running server 2008? If so I think there is an open bug report about running the script module against that version of Windows.

However it might be possible to solve the problem in a different way. Ansible 2.3 includes win\_domain\_membership modulehttp://docs.ansible.com/ansible/latest/win\_domain\_membership\_module.html which I think may be does what you need.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Anil](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@Anil](https://forum.ansible.com/u/Anil)\
**Post date:** [October 2, 2017, 1:26pm UTC](https://forum.ansible.com/t/windows-ansible-powershell-in-2-3-1/25646/3 "2017-10-02T13:26:17Z")

</div>

It is Windows Server 2008 R2 standard. Is this bug fixed in it 2.4?  
I am using the script for creating the object in Activer Directory OU only for both windows and linux machine, not sure if this module work for linux machine as the joining the domain process is differnt from windows. in any case I will give it a try, but I need to use domain ou path which is supported in 2.4 🙂  
Thanks Jon for the help.
