Query Domain For User
It s also possible to query all computers in the entire domain.
Query domain for user. If you do not specify this parameter then netdom query uses the domain to which the current computer belongs. Specifies the name of the session that you want to query. Specifies the remote desktop session host server that you want to query.
For example here is how you would query against your domain for all user accounts. By default the get aduser cmdlet returns only 10 basic user attributes out of more than 120 user account properties. The target is a function that shows all logged on users by computer name or ou.
To change user attributes use the set aduser cmdlet. In my test environment it took about 4 seconds per computer on average. To query for user accounts use the get aduser cmdlet.
Get aduser filter searchbase dc ad dc company dc com if you wanted to query for all of the user accounts with the last name collicott you would run the following. Note that this could take some time. Specifies the logon name of the user that you want to query.
Especially if you try to query the entire domain. Server server specifies the name of the domain controller that performs the query. To execute an ad query on a specific domain controller use the server parameter.