Counting your Active Directory Objects before Azure AD Connect Sync

When working with Active Directory do you know how many objects you have? Are you planning on synchronizing with Azure Active Directory?

If no and yes to the above these quick and easy PowerShell cmdlets can help you. When installing Azure AD Connect Express settings you are limited to only 100,000 objects.

Count Active Directory Users

(Get-ADUser -Filter *).Count

Count Active Directory Groups

(Get-ADGroup -Filter *).Count

Count Active Directory Computers

(Get-ADComputer -Filter *).Count

Count All Active Directory Objects

(Get-ADObject -SearchBase "dc=Mydomain,dc=com" -LDAPFilter "(objectCategory=*)").Count

Regards
The Author – Blogabout.Cloud