ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
199 stars 152 forks source link

community.windows.win_domain_user - add expiration date option #404

Closed monorailpilot closed 1 year ago

monorailpilot commented 2 years ago
SUMMARY

Please add an option to set the domain user expiration date as part of the user creation process.

ISSUE TYPE

Feature Idea

COMPONENT NAME

community.windows.win_domain_user

ADDITIONAL INFORMATION

This would be useful as it currently does not exist, forcing reliance on powershell scripts.

caidingyu commented 1 year ago

Any update on this request? It will be helpful to have this feature. Thanks!

jborean93 commented 1 year ago

The win_domain_user module has been deprecated by https://github.com/ansible-collections/community.windows/pull/516 in favour of microsoft.ad.user. See the migration guide for more info on how to change your code to use the newer module.

The microsoft.ad.user module can be used to set and LDAP attribute values that are needed rather than a hardcoded list that win_domain_user has. In this case the expiration date can be set with

- microsoft.ad.user:
    name: name
    state: present
    attributes:
      set:
        accountExpires: ...