#58442·salt

[BUG] Windows user.present failed usercase

Author: noelmcloughlinCreated Sep 12, 2020Updated Sep 29, 2026
LabelsbugWindows

Description On Windows, the user.present state fails to create a user XXX when group.present creates a group XXX.

Setup (Please provide relevant configs and/or SLS files (be

Installsomepackage2:
  group.present:
    - name: bob114
    - system: True
  user.present:
    - name: bob114
    - groups:
      - bob114
    - system: True

sure to remove sensitive info).

Steps to Reproduce the behavior (Include debug logs if possible and relevant)

$ salt-call.bat state.highstate --local
[ERROR   ] Error encountered during module reload. Modules were not reloaded.
[ERROR   ] Failed to create user bob114
[ERROR   ] nbr: 1379
[ERROR   ] ctx: NetUserAdd
[ERROR   ] msg: The specified local group already exists.
[ERROR   ] Failed to create new user bob114

          ID: Installsomepackage2
    Function: group.present
        Name: bob114
      Result: True
     Comment: Group bob114 is present and up to date
     Started: 22:28:38.861000
    Duration: 6.0 ms
     Changes:
----------
          ID: Installsomepackage2
    Function: user.present
        Name: bob114
      Result: False
     Comment: Failed to create new user bob114
     Started: 22:28:38.867000
    Duration: 36.0 ms

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
           Salt: 3000.3

Dependency Versions:
           cffi: 1.12.2
       cherrypy: 17.4.1
       dateutil: 2.8.0
      docker-py: Not Installed
          gitdb: 2.0.5
      gitpython: 2.1.10
         Jinja2: 2.10.1
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: Not Installed
   pycryptodome: 3.8.1
         pygit2: Not Installed
         Python: 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500
64 bit (AMD64)]
   python-gnupg: 0.4.4
         PyYAML: 5.1.2
          PyZMQ: 18.0.1
          smmap: 2.0.5
        timelib: 0.2.4
        Tornado: 4.5.3
            ZMQ: 4.3.1

System Versions:
           dist:
         locale: cp1252
        machine: AMD64
        release: 10
         system: Windows
        version: 10 10.0.19041  Multiprocessor Free

Additional context Add any other context about the problem here.