ComputerPowerShellTech Tips

PowerShell – How To Count Members In A Group

So you have an Active Directory group and you need to count how many users are in that group, but there is to many to count one by one, here is a script to do it for you :-

$users = Get-ADGroupMember -Identity 'Group Name'
$users.count

This will then return the total number of users in the group.




Image result for windows powershell logo

Duncan

Duncan is a technology professional with over 20 years experience of working in various IT roles. He has a interest in cyber security, and has a wide range of other skills in radio, electronics and telecommunications.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.