Powershell count of number of members in AD Security Group

John Darby
John Darby used Ask the Experts™
on
Is there a simple phrase to query against a Security Group to get a count of members?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Assuming that you have imported the ActiveDirectory module:

(Get-ADGroupMember "Domain Admins" | Measure-Object).Count


This could also be encapsulated in a function so that you could feed the name of the group in as a parameter.

Author

Commented:
Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial