# win\_user is not repeatable

**URL:** <https://forum.ansible.com/t/win-user-is-not-repeatable/24510>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [May 18, 2017, 9:19am UTC](https://forum.ansible.com/t/win-user-is-not-repeatable/24510 "2017-05-18T09:19:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary\_mcwilliams](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@gary\_mcwilliams](https://forum.ansible.com/u/gary_mcwilliams)\
**Post date:** [May 18, 2017, 9:19am UTC](https://forum.ansible.com/t/win-user-is-not-repeatable/24510/1 "2017-05-18T09:19:44Z")

</div>

A minimal playbook

```auto
---
# vim: set filetype=ansible ff=unix ts=2 sw=2 ai expandtab :
#
# Playbook to configure the environment

- hosts: createuser

  tasks:
    - name: create user
      run_once: true
      win_user:
        name: gary
        password: 'B0bP4ssw0rd123!^'
        password_never_expires: true
        account_disabled: no
        account_locked: no
        password_expired: no
        state: present
        groups:
          - Administrators
          - Users

```

When I run first time I get:

PLAY [createuser] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [dsy-demo-mssql02]

TASK [create user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [dsy-demo-mssql02]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
dsy-demo-mssql02 : ok=2 changed=1 unreachable=0 failed=0

When I re-run, I get:

PLAY [createuser] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [dsy-demo-mssql02]

TASK [create user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [dsy-demo-mssql02]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Exception calling "ValidateCredentials" with "2" argument(s): "The network path was not found.\r\n"”}

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @/root/ansible\_windows/createuser-playbook.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
dsy-demo-mssql02 : ok=1 changed=0 unreachable=0 failed=1

Just trying to work out if there is anything obvious I could be doing wrong.

I have verified that I can login to the created account.

verbose output is not much different:

TASK [create user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /root/ansible\_windows/createuser-playbook.yml:9  
Using module file /usr/lib/python2.6/site-packages/ansible/modules/windows/win\_user.ps1  
 ESTABLISH WINRM CONNECTION FOR USER: local\Administrator on PORT 5986 TO dsy-demo-mssql02  
EXEC (via pipeline wrapper)  
fatal: [dsy-demo-mssql02]: FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“msg”: “Exception calling "ValidateCredentials" with "2" argument(s): "The network path was not found.\r\n"”  
}

---

<div class="post-metadata">

**Author:** ![gary\_mcwilliams](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@gary\_mcwilliams](https://forum.ansible.com/u/gary_mcwilliams)\
**Post date:** [May 18, 2017, 9:21am UTC](https://forum.ansible.com/t/win-user-is-not-repeatable/24510/2 "2017-05-18T09:21:13Z")

</div>

Sorry, meant this for the ansible-project group
