First you should be familiar with making custom queries in Active Directory Users and Computers console. Here’s a quick instruction:
1) Open Active Directory Users and Computers console
2) Right click Saved Queries and select New -> Query
3) Click Define Query -button
4) Choose Custom Search from the dropdown menu and click Advanced -tab
5) Type your custom query in the textbox and click OK
6) Give your query a name and a description. Here you can also define a root for your search by clicking Browse… -button.
And here is the custom query for finding all Windows XP SP-1 computers in Active Directory:
(objectCategory=computer)(operatingSystemServicePack=Service Pack 1)(operatingSystem=Windows XP Professional)
userAccountControl:1.2.840.1135184.108.40.2063:=2 filters out disabled computer accounts. Others are quite self-explanatory.