#40347 - 2003-05-1707:03 PMRe: More on perceived FILTER problem
Howard BullockHoward Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
More info (From Steve @ Microsoft):
quote:What you are finding is correct. The Computer class is based on the User class, so if you filter on 'User' in the IADsContainer::Filter, it will also display the Computers located in that container. The reason the opposite is not true, is that the User does not have an entry for 'Computer' in it's objectClass attribute.
Unfortunately, the filter only will filter on the objectClass rather than the objectCategory, so this filter will not distinguish between User and Computer objects. If you have containers that have both User and Computer objects in it, I would work around it using one of the following techniques:
1. When looping through the objects in the IADsContainer object, check the objectCategory value and ensure it is Person. 2. Use ADO with the ADsDSoObject and execute a one level search on that container, filtering on objectCategory='Person'.
I am attaching a sample script that I had lying around that shows querying on the objectCategory. For further information concerning using the ADSI OLE-DB provider with ADO, please see the information at the following MSDN link.