SELECT TOP 10 cs-username AS UserID, cs(User-Agent) AS DeviceType, cs-uri-stem AS Vdir, c-ip AS CLIENT, Count(*) FROM '[LOGFILEPATH]' WHERE cs-uri-stem LIKE '%Microsoft-Server-ActiveSync%' GROUP BY UserID, DeviceType, Vdir, Client ORDER BY COUNT(*) DESC