Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

List AD Group members of a specific type?

$
0
0

I have the query below that returns all the members of certain groups types i.e. Domain Local but I'm looking to limit the results to specific type of members i.e. users rather than computer or global groups etc.  Any ideas?

$Groups = Get-ADGroup -Filter {groupscope -eq "DomainLocal"}
ForEach($GroupName In $Groups)
{
  "== Group name: {0} ==" -f $GroupName
  $MembersList = @()
  $MembersList = get-adgroupmember $GroupName | Select Name
  $MembersList
  "==== Total members: {0} ====" -f $MembersList.Length
}


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>