Skip to main content

Posts

Showing posts from February, 2011

Exporting and Uploading Mailbox Items using Exchange Web Services using the new ExportItems and UploadItems operations in Exchange 2010 SP1

Two new EWS Operations ExportItems and UploadItems where introduced in Exchange 2010 SP1 that allowed you to do a number of useful things that where previously not possible using Exchange Web Services. Any object that Exchange stores is basically a collection of properties for example a message object is a collection of Message properties, Recipient properties and Attachment properties with a few meta properties that describe the underlying storage thrown in. Normally when using EWS you can access these properties in a number of a ways eg one example is using the strongly type objects such as emailmessage that presents the underlying properties in an intuitive way that's easy to use. Another way is using Extended Properties to access the underlying properties directly. However previously in EWS there was no method to access every property of a message hence there is no way to export or import an item and maintain full fidelity of every property on that item (you could export the

Creating Inbox Rules with the EWS Managed API in Exchange 2010 SP1 with Powershell

One of the new features that was added in Exchange Web Services in 2010 SP1 (and improved in the Exchange Management Shell) was the ability to add Inbox Rules. Previously the only method for doing this programatically was a variety of Mapi methods some of which where not particular easy to use. Using the Exchange Management Shell New-InboxRule, Get-InboxRule and Set-InboxRule cmdlets offers an easy one-liner approach for the Admin but if you want to run your code as a non admin or you want to take advantage of EWS Impersonation to create rules on behalf of the user then Exchange Web Services is a good option for this. There are 3 major components to rules RuleConditions RuleExceptions (Optional) RuleActions Rule Conditions and Exceptions are essential the same they use the same objecttype RulePredicates the difference is that the conditions in ruleconidtions dictate what items a rule fires on and the exceptions dictates the conditions it doesn't fire on. With both the
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.