Currently there is an ansible module to easily perform an interactive (GUI) login.
- name: Set autologon for user1 with a limited logon count community.windows.win_auto_logon: username: User1 password: str0ngp@ssword logon_count: 5