I have been attempting over the last few days to determine a user's COS from search results so I can get aggregate COS Data. I have tried using SearchDirectoryRequest, and SearchAccountsRequest. I have also tried GetAllCos and then doing searches seeded with the COS ID, but nothing works.

Searching for all users using SearchDirectory, SearchAccounts, or even getAllAccounts only returns COS data for those users who have a COS specifically defined, not for users who use the default COS for their domain. They also do not appear to return what domain the user is a part of.

If I attempt to get all COS ID's using GetAllCosRequest, then I do a search using zimbraCOSId=[value], again only users who's COS ID is explicitly set in the admin interface are returned.

I would like to avoid running one query per user, as this is highly inefficient. But, so far, all I can think to do is

Get All Acounts
getAccountInfo for this account
excract COS from the response, and aggregate this way

This seems highly inefficient. Is there any other search path?