Hi Buddies,
I am working on a basic script that imports group list from a text file and then check if the group having no members.
import-csv .\groups.txt | foreach-object {
Get-ADGroup -identity $_.samaccountname -Properties Members | where {-not $_.members} | select Name, members | Export-Csv .\emptygroups.csv –NoTypeInformation
}When I am exporting it to csv, I am getting only the last group in the output. Can you please let me know what is wrong in this code?
Thanks!!
Himanshu
MCTS|MCSE|MCSA:Messaging|CCNA