【问题标题】:Powershell LDAP query to get all groups, owners,members by OUPowershell LDAP 查询以按 OU 获取所有组、所有者、成员
【发布时间】:2017-01-19 01:11:27
【问题描述】:

我需要编写一个包含 OU 的 powershell 脚本 并返回所有组及其所有者,但如果没有所有者,则返回所有成员

我几乎有 0 的 powershell 知识,任何有用的帮助,我都安装了活动目录模块

【问题讨论】:

  • 简单地询问对你没有帮助。您必须先在这里尝试一下。

标签: powershell active-directory ldap


【解决方案1】:

试试这个示例:

Import-Module ActiveDirectory ;
Get-ADGroup -Filter {name -like "*Your Group Name*"} -Properties Description,info | Select Name,samaccountname #| Export-Csv D:\output.csv -NoTypeInformation
Get-ADGroupMember YourGroupName # to list members ;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多