copy active directory user

Hi
I found how to create a new user in my Windows active directory with ansible, but we usually copy a, existing in order to add the group needed more easyly

Is there a similiare possibility to copy an existing user with all the specification and just modify first name and last name and password

Thanks
Nicolas

I have no idea what you current playbook looks like, and I have not
used ansible to manage Windows, so I am going to assume you are using
the win_domain_user module to create a user.
Looking at the docs, the 'state' parameter accepts a 'query' value:

https://docs.ansible.com/ansible/2.9/modules/win_domain_user_module.html#parameter-state

I would do something like this:

- win_domain_user to query existing user, and register result
- set_fact to change only a few value in that data structure
- win_domain_user to create a new users with that data structure

thanks i will search in this direction