Skip to content

This Ansible module gets information from local Windows user accounts.

License

Notifications You must be signed in to change notification settings

informatique-cdc/ansible-role-win_user_info

Repository files navigation

win_user_info - Gather facts about local Windows user accounts

Synopsis

  • This Ansible module gets information from local Windows user accounts.

Examples

---
- name: test the win_user_info module
  hosts: all
  gather_facts: false

  roles:
    - win_user_info

  tasks:
    - name: Gather facts about all local Windows user accounts
      win_user_info:
      register: all_users_info

    - name: Displays the facts
      debug:
        var: all_users_info

    - name: Gather facts about local Windows administrator user account
      win_user_info:
        sid: '*-500'
      register: admin_user_info

    - name: Displays the facts
      debug:
        var: admin_user_info

    - name: Gather facts about local Windows user account whose name begin with admin
      win_user_info:
        name: 'admin*'
      register: admin_user_info

    - name: Displays the facts
      debug:
        var: admin_user_info

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
local_user_info
complex
success Metadata about local Windows users.
        account_disabled
        boolean
Indicates whether the account is disabled.
        account_locked
        boolean
Indicates whether the account is locked.
        description
        string
Description of the user.
        fullname
        string
Full name of the user.
        groups
        list
List of groups.
        home_directory
        string
The designated home directory of the user.
        last_logon
        string
The date and time when the last logon occurred.
        login_script
        string
The login script of the user.
        name
        string
Name of the user.
        password_changeable_date Indicates the date with the user have to change their password.
        password_expired
        boolean
Indicates whether user have to change their password at next login.
        password_last_set
        string
Indicates the date of password last set.
        password_never_expires
        boolean
Indicates whether the password never expires.
        password_required
        boolean
Indicates whether the password is required.
        profile
        string
The profile path of the user.
        user_cannot_change_password
        boolean
Indicates whether the user can change their password.

Authors

  • Stéphane Bilqué (@sbilque) Informatique CDC

License

This project is licensed under the Apache 2.0 License.

See LICENSE to see the full text.