Hi
I want to export all global groups with an m in it to Excel.
foreach($group in (Get-ADGroup -filter "name -like 'G*m*'")){Get-ADGroupMember -Identity $group | select @{n='GroupName';e={$group.name}},samaccountname,name}
in powershell i get a list with all the groups and there members . So now i want to export to Excel:
foreach($group in (Get-ADGroup -filter "name -like 'G*m*'")){Get-ADGroupMember -Identity $group | select @{n='GroupName';e={$group.name}},samaccountname,name | export-csv -path d:\groupswithM.csv -Delimiter ";"}
All i get in my sheet is the last group in my variable.
help I want the same output that i get exported to an excel sheet! Help.
thx in advance.