copy active directory user

29 views
Skip to first unread message

Nicolas Talvasson

unread,
Nov 6, 2020, 5:41:53 AM11/6/20
to Ansible Project
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

Dick Visser

unread,
Nov 6, 2020, 6:00:19 AM11/6/20
to ansible...@googlegroups.com
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
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c208c274-955b-41e7-b98b-882a2bf17b63n%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Nicolas Talvasson

unread,
Nov 6, 2020, 10:07:41 AM11/6/20
to Ansible Project
thanks i will search in this direction
Reply all
Reply to author
Forward
0 new messages