Skip to content

microsoft.ad.group module fails to add member to existing group #196

Description

@sigveo
SUMMARY

When trying to add a computer to an existing Active Directory group, the play fails with error "New-ADGroup failed: The specified group already exists"

ISSUE TYPE
  • Bug Report
COMPONENT NAME

microsoft.ad.group module

ANSIBLE VERSION

COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT

Windows server 2025

STEPS TO REPRODUCE
- name: Define name of computer to be added to group
  ansible.builtin.set_fact:
    group_member: "{{ ansible_netbios_name }}$"

- name: Add computer to group in AD
  microsoft.ad.group:
    name: "{{ existing_group_name }}"
    scope: global
    members:
      add:
        - "{{ group_member }}"
    domain_username: "{{ domain_username }}"
    domain_password: "{{ domain_user_password }}"
  delegate_to: "{{ management_server_with_ActiveDirectory_module }}"
EXPECTED RESULTS

The computer to be added to the active directory group while preserving existing members

ACTUAL RESULTS

Fails with error "New-ADGroup failed: The specified group already exists"


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions