none
Powershell - AD Groups - view total number of users in each group. RRS feed

  • Question

  • Hi

    I have a list of AD groups saved in a text file (+- 400) and I would like to have visibility on the total number of users in each group. Can this be scripted and exported to a csv to use the list I have and simply show the number of users per AD Group ?

    Thanks



    • Edited by Ivan Davids Tuesday, September 8, 2015 6:24 AM
    Tuesday, September 8, 2015 6:23 AM

Answers

  • Get-AdGroup -filter * -Properties members |select name, @{N='Count';E={$_.members.count}} | ft -auto


    \_(ツ)_/

    • Proposed as answer by Dyakov Alexander Tuesday, September 8, 2015 12:17 PM
    • Marked as answer by Ivan Davids Wednesday, September 9, 2015 5:31 AM
    Tuesday, September 8, 2015 6:38 AM
  • Use Get-Content to read the input file and ForEach-Object to loop jrv's example above.

    • Marked as answer by Ivan Davids Wednesday, September 9, 2015 5:31 AM
    Tuesday, September 8, 2015 12:55 PM

All replies