output to csv displaying AD group names and total members
so i'm trying write script parse text file containing group names , each 1 count members -
i've got work lists numbers on screen. need output csv column showing group names , column b showing numbers:
import-module activedirectory
$a = get-content "e:\scripts\spgroups.txt"
foreach ($i in $a) {
(get-adgroup $i -properties *).member.count
}
can help? i've been experimenting export-csv grouptotals.csv - can't work yet
thanks
j
get-adgroup groupname -properties member | select name, @{n='count';e={$_.member.count}}
¯\_(ツ)_/¯
Windows Server > Windows PowerShell
Comments
Post a Comment