Incorrect flag defined for disabling AD computer account in win_system.py #37132
Labels
Bug
broken, incorrect, or confusing behavior
Pending-Discussion
The issue or pull request needs more discussion before it can be closed or merged
Milestone
Description of Issue/Question
The
unjoin_domain
function in win_system.py specifies an incorrect flag for disabling AD computer objects. The offending value is located here:https://github.com/saltstack/salt/blob/develop/salt/modules/win_system.py#L762
According to Microsoft documentation, the
NETSETUP_ACCT_DELETE
flag should be0x4
, not0x2
:https://msdn.microsoft.com/en-us/library/aa393942(v=vs.85).aspx
Setup
Running in masterless minion mode with the log level set at
DEBUG
Steps to Reproduce Issue
Running the following:
c:\salt\salt-call.bat system.unjoin_domain domain='domain' username='user' password='password' disable=True restart=True
Returns the following error, twice:
After looking at the
C:\Windows\debug\NetSetup.log
file, I found the following:Thus determining the 0x2 flag defined here is not correct. Changing this to
0x4
allows this to function properly.Versions Report
The text was updated successfully, but these errors were encountered: