Examples: To find all users in a given organizational unit (OU) whose name starts with "jon" and whose account has been disabled for logon and display their user principal names (UPNs): dsquery user ou=Test,dc=microsoft,dc=com -o upn -name jon* -disabled To find all users in only the current domain, whose names end with "smith" and who have been inactive for 3 weeks or more, and display their DNs: dsquery user domainroot -name *smith -inactive 3 To find all users in the OU given by ou=sales,dc=microsoft,dc=com and display their UPNs: dsquery user ou=sales,dc=microsoft,dc=com -o upn
Examples: To find all groups in the current domain whose name starts with "ms" and whose description starts with "admin", ...
Examples: To find all OUs in the current domain whose name starts with "ms" and whose description starts with "sales", and ...
Examples: To find all sites in North America with name starting with "north" and display their DNs: dsquery site -name north* ...
Examples: To find all subnets with the network IP address starting with 123.12: dsquery subnet -name 123.12.* To find all ...
Examples: To find all users in a given organizational unit (OU) whose name starts with "jon" and whose account has been disabled ...
Examples: To find all users in a given OU whose names start with "jon" and display their descriptions, type: dsquery user ...
Examples: To find all users in the current domain only whose SAM account name begins with the string "jon" and display their ...
Examples: To find all users in the organizational unit (OU) "ou=Marketing,dc=microsoft,dc=com" and add them to the Marketing ...
Examples: To find all users with names starting with "John" and display their office numbers: dsquery user -name John* | ...