有没有办法在不使用 win_shell 模块的情况下获取域用户属于使用 ansible 模块的组列表

发布于 2025-01-20 23:37:22 字数 302 浏览 3 评论 0原文

我想从本地组中删除域用户,但找不到目前正在使用的本地组的域用户

- name: Add a local and domain user to a local group
  win_group_membership:
    name: administrators
    members:
      - testldn2-1
           #- DOMAIN\TestUser
    state: absent

,但对于单个组起作用

I want to delete the domain user from local groups but unable to find the domain user is part of which local group currently I'm using

- name: Add a local and domain user to a local group
  win_group_membership:
    name: administrators
    members:
      - testldn2-1
           #- DOMAIN\TestUser
    state: absent

but this works for individual group

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无畏 2025-01-27 23:37:22

尝试一下

- name: remove domain user from groups list
  win_domain_user:
    name: <user>
    state: present
    groups:
      - Power Users # group names here
      - Remote Destop Users 
    groups_action: remove

此处查找文档

try this

- name: remove domain user from groups list
  win_domain_user:
    name: <user>
    state: present
    groups:
      - Power Users # group names here
      - Remote Destop Users 
    groups_action: remove

Find the Documentation Here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文