This is sample 2 from the Item Age section of my MEC talk in this sample we'll look at reporting on the Folder ItemCounts and Size of Item's in a Mailbox based on the age of those items. To work out the Size and Item Count of all the Items in a Mailbox and be able to report on the age of those Items requires that you enumerate through every item in every folder in a Mailbox. Doing this on a mailbox with a large number of folder Items will take some time (it's pretty elementary Watson). So to reduce the amount of work that the server has to do to return information about all the Items in the Mailbox it's important to use the IdOnly BasePropertySet and then add the properties that are required. For this report the following properties are used. Size, DateTimeReceived, DateTimeCreated This script first uses a FindFolder operation to enumerate all folders in a Mailbox and then on each folder a findItems is used to enumerate ever item. Using just these three properti...
Pushing the Envelope in Messaging and Office 365 Development