【发布时间】:2017-01-19 01:11:27
【问题描述】:
我需要编写一个包含 OU 的 powershell 脚本 并返回所有组及其所有者,但如果没有所有者,则返回所有成员
我几乎有 0 的 powershell 知识,任何有用的帮助,我都安装了活动目录模块
【问题讨论】:
-
简单地询问对你没有帮助。您必须先在这里尝试一下。
标签: powershell active-directory ldap
我需要编写一个包含 OU 的 powershell 脚本 并返回所有组及其所有者,但如果没有所有者,则返回所有成员
我几乎有 0 的 powershell 知识,任何有用的帮助,我都安装了活动目录模块
【问题讨论】:
标签: powershell active-directory ldap
试试这个示例:
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 ;
【讨论】: