Query Domain User Account
Dsquery user limit 0 disabled dsget user samid dsquery query for all users and retrieve samaccountname and cn.
Query domain user account. Querying for user accounts. If you need to query for all users that have domain users designated as their primary search for all users whose primarygroupid attribute is 513. This is true unless if your containers ous objects acls were changed to explicitly deny this querying.
Dsquery filter objectcategory person objectclass user limit 0 attr samaccountname cn vbscript query for all users and display the pre windows 2000 logon name. Query disabled users and list their samaccountnames. To be sure that you can query your ad with no problems with a user account you can run cmd or powershell with the credentials of the user account and test some ldap queries.
For example here is how you would query against your domain for all user accounts. Get aduser is one of the basic powershell cmdlets that can be used to get information about active directory domain users and their properties. You can use the get aduser to view the value of any ad user object attribute display a list of users in the domain with the necessary attributes and export them to csv and use various criteria and filters to select domain users.
Userd domain user specifies the user account that makes the connection with the domain that you specify in the d or domain parameter. 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. User name jsmith full name smith john comment user s comment country code null account active yes account expires 12 16 2015 11 00 00 pm password last set 12 31 2014 9 19 08 am password expires 2 29 2015 9 19 08 am password changeable 1 5 2015 9 19 08 am password.
A normal user account should be able to do ldap queries. The ldap syntax filter could be. The primarygrouptoken attribute of the group domain users is the same integer 513.