【发布时间】:2019-05-02 23:54:16
【问题描述】:
有很多关于如何从文本文件中获取特定组的成员并将它们输出到 CSV 的指南,我现在精通这些指南,但是它们并不完全符合我的标准和我的知识完全不能让我越过这个界限。
我有以下
$Filename = "C:\Users\Username\Desktop\AD Groups.txt"
$GroupName = Get-Content $Filename
Get-ADGroupMember -identity $GroupName | select name, $GroupName | Export-
csv -path C:\Temp\Groupmembers.csv -NoTypeInformation
我想要做的是获取文本文件中指定的组中的用户并将它们输出到看起来像这样的 CSV 文件
GroupName MemberName
Group 1 All the members of that group ...
Group 2 All the members of that group ...
我找到的所有当前版本都这样做
Group Name MemberName
Group 1 Name1
Group 1 Name 2
Group 2 Name 1
Group 2 Name 2
Group 3 Name 1
等等
【问题讨论】:
标签: powershell active-directory