How to count number of objects in active directory

By | November 20, 2018

How to count number of objects in active directory

How to count how may objects in AD? How many users, computers and group?

Due to compliance or Asset/inventory/License management purpose we always need a count of system we have in our environment. If you are running Microsoft Windows platform and has Active Directory environment. So, best solution is “Get-AD” power-shell command.

Commands are:

(Get-ADUser -Filter *).Count
(Get-ADGroup -Filter *).Count
(Get-ADComputer -Filter *).Count
(Get-ADObject -SearchBase "cn=Configuration,dc=mydomain,dc=com" -LDAPFilter "(objectClass=site)").Count
(Get-ADObject -SearchBase "dc=Mydomain,dc=com" -LDAPFilter "(objectCategory=*)").Count
  



VN:F [1.9.22_1171]
Please Rate & Comment !
Rating: 5.0/5 (1 vote cast)
How to count number of objects in active directory, 5.0 out of 5 based on 1 rating

One thought on “How to count number of objects in active directory

  1. Pingback: Active Directory Interview questions with answers

Comments are closed.