Sunday, November 15, 2015

Get-ADGroupMember - lists machines or user members of groups


Commands to output the members of a group

Get-ADGroupMember -Id <GroupName> | Export-CSV c:\temp\GroupOutput.CSV -NoTypeInformation 

this one uses the -recursive switch which lists the members of groups within the group.  Note the use of multiple -notlike items

Get-ADGroupMember -Identity <GroupName> -recursive | Select name | sort name | where {$_.name -notlike "MACH*" -and $_.name -notlike "VW*"}