When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance How to format code in PowerShell.org
You need to expand the multivalued property before you can count the values:
Regardless of that - foramt cmdlets like Format-List are build to display information on the console only. So if you want to add further steps you should never use format cmdlets.
Thank you, now it works.
Do i need to go via $SearchBase or can i just go via Get-ADuser -Filter * -Properties MemberOf?
Is there any specific reason to search/indicate for the location?