While that link is a good start it is horribly bad performance.
If you are going to do a good bit of AD management I would strongly recommend getting the Quest cmdlets for Free from
www.quest.com/powershellBelow is the native way to get the count. Not sure what else you are after.