# ansible and windows AD module

**URL:** <https://forum.ansible.com/t/ansible-and-windows-ad-module/24905>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 5, 2017, 3:53pm UTC](https://forum.ansible.com/t/ansible-and-windows-ad-module/24905 "2017-07-05T15:53:13Z")\
**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:** [July 5, 2017, 3:53pm UTC](https://forum.ansible.com/t/ansible-and-windows-ad-module/24905/1 "2017-07-05T15:53:13Z")

</div>

I am trying to invoke AD commands( I put this into powershellscript) from ansible server. I am using Kerberos in the ansible server for auth. Can you guys help in this issue?

Below is my powershell script runs on windows server(windows server 2008 r2 standard), which is in domain. I am able to run this powershell script fine when I RDP into this machine. But fails when i run this script from powershell.

---

<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:** [July 7, 2017, 10:02am UTC](https://forum.ansible.com/t/ansible-and-windows-ad-module/24905/2 "2017-07-07T10:02:20Z")

</div>

Possibly a second hop issue. Try setting ansible\_winrm\_kerberos\_delegation: true  
in your windows inventory (documented at the end of this section of the documentation page:  
[http://docs.ansible.com/ansible/intro\_windows.html#inventory](http://docs.ansible.com/ansible/intro_windows.html#inventory)

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:** [July 13, 2017, 7:56pm UTC](https://forum.ansible.com/t/ansible-and-windows-ad-module/24905/3 "2017-07-13T19:56:39Z")

</div>

thank you Hawkesworth, that worked.
