You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two user created successfully. I was able to delete first user by adhoc command.
But 2nd user not found while trying to delete by adhoc command. But 2nd user exists in Windows AD.
Play book and logs are attached below:
➜ ansible-galaxy collection list | grep microsoft.ad
microsoft.ad 1.4.1
Here is my var files:
users:
- name: bob
firstname: Bob
surname: Smith
company: Ericsson
password: tWelvepass!12tWelvepass!12
email: [email protected]
- name: magnus
firstname: Magnus
surname: Smith
company: Ericsson
password: tWelvepass!12tWelvepass!12
email: [email protected]
➜ ansible-playbook playbook/windows_user.yml -i dc1prod-hosts
PLAY [Create windows User] ******************************************************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************
ok: [10.74.2.10]
TASK [Create windows user] ******************************************************************************************************************************************************************************************************
changed: [10.74.2.10] => (item={'name': 'bob', 'firstname': 'Bob', 'surname': 'Smith', 'company': 'Ericsson', 'password': 'tWelvepass!12tWelvepass!12', 'email': '[email protected]'})
changed: [10.74.2.10] => (item={'name': 'magnus', 'firstname': 'Magnus', 'surname': 'Smith', 'company': 'Ericsson', 'password': 'tWelvepass!12tWelvepass!12', 'email': '[email protected]'})
[WARNING]: Failed to enumerate user groups but continuing on: The operation being requested was not performed because the user has not been authenticated
PLAY RECAP **********************************************************************************************************************************************************************************************************************
10.74.2.10 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
➜ ansible -m ansible.windows.win_user -a 'name=magnus state=absent' -i dc1prod-hosts win
10.74.2.10 | SUCCESS => {
"changed": false,
"msg": "User 'magnus' was not found",
"name": "magnus",
"state": "absent"
}
Why magnus user not found?
Though in windows AD user exists:
Please check why magnus user is not found?
If we replace magnus with other name. It works.
The text was updated successfully, but these errors were encountered:
bantify
changed the title
Created user not found while deleting by ad-hoc command
microsoft.ad.user | Created user not found while deleting by ad-hoc command
Mar 27, 2024
bantify
changed the title
microsoft.ad.user | Created user not found while deleting by ad-hoc command
microsoft.ad.user - Created user not found while deleting by ad-hoc command
Mar 27, 2024
Where is the user magnus located in the AD site. When you specify name: magnus it will attempt to find the user at CN=magnus,$defaultUserLocation where $defaultUserLocation is the default location that new users are created at. You can get the default path by running
In my domain's case it is CN=Users,DC=domain,DC=test. So if the user magnus is located in another container, for example another OU, then the module will fail to find it.
If you wish to lookup a user by the sAMAccountName then you need to use the identity option. The name option is strictly just for the name/cn of the user in the LDAP sense whereas identity is a way to lookup the user using a it's sAMAccountName, distinguishedName, objectSID, objectGuid.
Summary
Two user created successfully. I was able to delete first user by adhoc command.
But 2nd user not found while trying to delete by adhoc command. But 2nd user exists in Windows AD.
Play book and logs are attached below:
SUMMARY
ISSUE TYPE
COMPONENT NAME
Ansible version:
Galaxy version:
Here is my var files:
My playbook:
Play book run logs:
bob user delete:
magnus user delete:
Why magnus user not found?
Though in windows AD user exists:
Please check why magnus user is not found?
If we replace magnus with other name. It works.
The text was updated successfully, but these errors were encountered: