【问题标题】:Not able to update objectClass attribute of AD domain group using ansible无法使用 ansible 更新 AD 域组的 objectClass 属性
【发布时间】:2021-12-17 05:25:45
【问题描述】:

Image where I modified

使用 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


【解决方案1】:

感谢Mathias R. Jessen 的建议。发布此答案以帮助其他社区成员。

用户对象的 objectClass 属性将标识 toppersonorganizationalPersonuser 类。

对象实例创建时系统设置objectClass值,不能更改。

尝试更新对象类时出错

请参考这篇文章:Object Class and Object Category - Win32 apps | Microsoft Docs

【讨论】:

    猜你喜欢
    • 2015-04-12
    • 2020-12-22
    • 1970-01-01
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 2019-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多