Forum Discussion
Using Get-ADComputer Syntax
Active Directory is a multi-master directory service. This means that all domain controllers hold exactly the same information (allowing for minor variations where inter-site replication takes place).
It does not matter which domain controller you run your query against, they will return the same result set.
If you're in a forest with more than one domain, the domain queried will be governed by the defaultNamingContext associated with your computer's account. You can verify this value with the following PowerShell command:
([adsi]"LDAP://RootDSE").defaultNamingContext
As per AndySvints' comment, you can override this default search location using a combination of -SearchBase, -SearchScope and -Server.
Note: If you are in a multi-domain forest, searching the forest root will not allow you to discover computers in the child domains (by default). You can get around this by specifying that you wish to run your search against a global catalog server (GC) but this comes with the trade off that not all the class' attributes are available in such a search.