Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microsoft.ad.group: Member names (sAMAccountName) with more than 20 characters not supported #63

Closed
mbx64 opened this issue Aug 8, 2023 · 4 comments · Fixed by #95
Closed

Comments

@mbx64
Copy link

mbx64 commented Aug 8, 2023

SUMMARY

I use microsoft.ad.group to add members to an already existing group. This module complains it cannot find some groups that should be added as members. The groups it cannot find are groups that have a sAMAccountName with more than 20 characters.

I know there was an antique limit of 20 characters for sAMAccountNames. But since Winodows Server 2000, we can have sAMAccountNames with max. length of 256.

The deprecated community.windows.win_domain_group_membership module actually can handle members whose names are longer than 20 characters.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

group

ANSIBLE VERSION
ansible [core 2.15.2]
  config file = /home/user/.ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/.local/bin/ansible
  python version = 3.9.16 (main, Jan 17 2023, 18:53:15) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /home/user/.local/lib/python3.9/site-packages/ansible_collections
Collection   Version
------------ -------
microsoft.ad 1.2.0
CONFIGURATION
CONFIG_FILE() = /home/user/.ansible.cfg
DEFAULT_STDOUT_CALLBACK(/home/user/.ansible.cfg) = yaml
OS / ENVIRONMENT

Target OS: Windows Server 2019

STEPS TO REPRODUCE
- name: Add group members
  microsoft.ad.group:
    name: Protected Users
    identity: S-1-5-21-XXX-525
    members:
      add:
        - GroupNameOK
        - GroupNameWayTooLongAndNotOK
EXPECTED RESULTS

OK

ACTUAL RESULTS
fatal: [hostname]: FAILED! => changed=false 
  distinguished_name: CN=Protected Users,CN=Users,DC=my,DC=domain,DC=com
  msg: 'Failed to find the following ad objects for group members: ''GroupNameWayTooLongAndNotOK'''
  object_guid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@BenLangers
Copy link

Little to add except I have the exact same issue...
Any workaround available to actually find those groups with the microsoft.ad.group module at the moment?

@jborean93
Copy link
Collaborator

Sorry for not replying to the issue earlier, it's certainly something we should be looking at to fix.

@mbx64
Copy link
Author

mbx64 commented Oct 18, 2023

Little to add except I have the exact same issue... Any workaround available to actually find those groups with the microsoft.ad.group module at the moment?

@BenLangers You can still use community.windows.win_domain_group_membership instead, as long as it is available.

@jborean93
Copy link
Collaborator

This has been fixed with #95.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants