【发布时间】:2021-12-17 05:25:45
【问题描述】:
使用 Ansible 尝试创建 AD 域组并更新 objectClass 属性。
- name: Create group
community.windows.win_domain_group:
name: "{{ item.name }}"
scope: global
category: security
state: present
attributes: "{{ item.attributes }}"
with_items:
- name: group1
attributes:
gidNumber: 1234
objectClass:
- group
- posixGroup
- top
【问题讨论】:
-
获取以下错误失败:[ad1] (item={'name': 'group1', 'attributes': {'gidNumber': 1234, 'objectClass': ['group', 'posixGroup ', 'top']}}) => {"ansible_loop_var": "item", "changed": false, "created": false, "item": {"attributes": {"gidNumber": 1234, "objectClass ": ["group", "posixGroup", "top"]}, "name": "group1"}, "msg": "创建组 group1 失败:无法转换类型为 'System.String[]' 的对象输入'System.String'。"}类似的事情适用于域用户但不起作用对于域组
-
你好viswam,如果我的回答对你有帮助,你可以接受它作为答案(点击答案旁边的复选标记,将它从灰色切换到填充。)。这对其他社区成员可能是有益的。谢谢
-
Active Directory 用户和计算机 - 我们在其中创建用户和组,通过此工具,我可以更改用户和组的属性 objectclass。对用户使用 ansible 我可以更改但不能用于组。
标签: powershell ansible active-directory