# AD Module

**URL:** <https://forum.ansible.com/t/ad-module/38638>\
**Category:** Ansible Project\
**Tags:** windows, awx\
**Created:** [January 2, 2024, 7:01pm UTC](https://forum.ansible.com/t/ad-module/38638 "2024-01-02T19:01:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thirumalairaja](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@thirumalairaja](https://forum.ansible.com/u/thirumalairaja)\
**Post date:** [January 2, 2024, 7:01pm UTC](https://forum.ansible.com/t/ad-module/38638/1 "2024-01-02T19:01:12Z")

</div>

Hi, gys

i have a task to manage AD objects like create, delete using ansible task right now i am using win\_shell command module to run the command on windows target and creating AD objects. But I need to do it the same using an inbuilt ansible module like [microsoft.ad](http://microsoft.ad) about my target host will be localhost as its linux so that no dependency of windows target any one can guide me on this.

I am using AWX tower to run the playbook and AWX is running on the K8 cluster.

Regards,

Thirumalai

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 2, 2024, 8:06pm UTC](https://forum.ansible.com/t/ad-module/38638/2 "2024-01-02T20:06:58Z")

</div>

I’m slightly confused about what you are asking for.

It sounds like you are currently managing AD objects in an existing domain controller by using win\_shell commands targeting that domain controller. So far so good.

The part that confuses me is “my target host will be localhost as it’s linux” and “no dependency of windows target”. Are you running a windows domain on linux with a linux host as the domain controller? Are we talking about a genuine windows domain here and not an IPA suite? (Although that would be sweet!)

Then I’m even more confused by “I am using AWX […] on [kubernetes]”. Surely you aren’t running your domain controller on the same host(s) as your AWX instance(s)?

I’m not a windows domain admin — which may be painfully obvious from my confusion, displayed above. But if my guesses are correct, then the crucially important point is tucked away in [these docs’](https://docs.ansible.com/ansible/latest/collections/microsoft/ad/object_module.html#notes) “Notes” section:

- If running on a server that is not a Domain Controller, credential delegation through CredSSP or Kerberos with delegation must be used or the _domain\_username_, _domain\_password_ must be set.

If you do get it working, please drop a followup message to this thread indicating what you needed to do. You surely aren’t the only one with the issue.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [January 2, 2024, 8:13pm UTC](https://forum.ansible.com/t/ad-module/38638/3 "2024-01-02T20:13:14Z")

</div>

There is the sssd service for Linux that joins a Linux host to an AD domain. With that you can use properly credentialed **adcli** commands to manipulate AD objects.

Walter

---

<div class="post-metadata">

**Author:** ![Evan\_Hisey](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Evan\_Hisey](https://forum.ansible.com/u/Evan_Hisey)\
**Post date:** [January 2, 2024, 10:15pm UTC](https://forum.ansible.com/t/ad-module/38638/4 "2024-01-02T22:15:03Z")

</div>

Why would you not want to be running the MS AD modules against a dedicate Windows AD management server? Understandably to tno run on an actual AD server, but most Windows domains have a dedicated Management/Utilities host for doing things like this. All the Microsoft AD community modules require the ActiveDirectory Powershell module. That is going to cause you several issue with running on the AWX controller (bad idea in general). You should look at Ansible execution environments to use Ansible builder to build a linux powershell container in your K8 cluster to for this. That of course assumes that the ActiveDirectory powershell module is available on Linux.

---

<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:** [January 3, 2024, 7:38pm UTC](https://forum.ansible.com/t/ad-module/38638/5 "2024-01-03T19:38:38Z")

</div>

> That of course assumes that the ActiveDirectory powershell module is available on Linux.

It isn’t, it’s a Windows only component that cannot be installed independently. What OP wants to do with the microsoft.ad.x modules cannot be done outside of a Windows target host. They would have to find another tool/set of modules that can run on Linux.

---

<div class="post-metadata">

**Author:** ![Evan\_Hisey](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Evan\_Hisey](https://forum.ansible.com/u/Evan_Hisey)\
**Post date:** [January 3, 2024, 10:37pm UTC](https://forum.ansible.com/t/ad-module/38638/6 "2024-01-03T22:37:53Z")

</div>

### jborean93-Thanks for the confirmation. I was pretty sure that was the case, but had only recently learned that Powershell had linux versions and not up on what has or has not been ported over yet.

---

<div class="post-metadata">

**Author:** ![thirumalairaja](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@thirumalairaja](https://forum.ansible.com/u/thirumalairaja)\
**Post date:** [January 31, 2024, 7:45pm UTC](https://forum.ansible.com/t/ad-module/38638/7 "2024-01-31T19:45:15Z")

</div>

HI,Evan Hiseyi found that AD module not available for linux

---

<div class="post-metadata">

**Author:** ![Evan\_Hisey](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Evan\_Hisey](https://forum.ansible.com/u/Evan_Hisey)\
**Post date:** [February 5, 2024, 6:08am UTC](https://forum.ansible.com/t/ad-module/38638/8 "2024-02-05T06:08:36Z")

</div>

So why exactly do you need to manipulate windows AD onna Linux host? Makes more sense to do that on a windows host no matter how you look at it.

---

<div class="post-metadata">

**Author:** ![thirumalairaja](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@thirumalairaja](https://forum.ansible.com/u/thirumalairaja)\
**Post date:** [February 5, 2024, 7:31pm UTC](https://forum.ansible.com/t/ad-module/38638/9 "2024-02-05T19:31:36Z")

</div>

Actually I have terraform file to build a Linux and Windows server on Vcenter. I have been asked to create Custom EE and using that need to build a Windows and Linux servers  
So I just created Custom EE for AWX with terraform installed now, when I come to build a window VM the prerequisites is to create AD object first then only I can Able to add VM to domain 😔 and i suggested to use loca host only not a delegation option for adding object creation that’s why I am trying to install ad module on my Custom EE the below dependency I need to install my Execution environment to manage full infra cycle management

1. Terraform - build a VM
2. packer - to build a Temple
3. Ad module - to manage AD Module
4. Ping module - for ping a ip to know the free IPs
5. Vinyl CLI - our won CLI to register ip in IP control
