EWS Managed API Trace Listener

MSDN has some sample code showing how to implement a trace listener for the EWS Managed API (which is crucial for debugging EWS applications).  However, the sample trace listener isn’t actually very good for a variety of reasons (it creates different files for each trace type, and will actually overwrite the previous trace if the…


Programmatically manage OWA 2013 folder conversation view settings

As a few people have requested this, I’ve written a .Net sample for managing folder Conversation View settings for OWA 2013. In Exchange 2013, the Conversation View settings are stored the FolderViewState element of the OWA.ViewStateConfiguration configuration item stored in the associated content of the Root folder. This sample can be used to list or…

1

PowerShell/EWS: Searching for and deleting duplicate mailbox folders

We’ve had some cases recently where an issue with migration has caused the migrated mailbox to contain duplicate folders (e.g. there may be two Calendar folders).  I have written a script that can process mailboxes and automatically remove duplicate folders.  In the case of special folders (Inbox, Sent Items, etc.) the correct folder will be…


EWS: How to send signed email using the EWS Managed API

A question that keeps popping up is how to send signed or encrypted email using EWS.  A colleague (thank-you Vladimir!) has recently put together some sample code showing how to do exactly that using the EWS Managed API.  Based on his sample code, I’ve been able to partially complete my Windows Forms application that shows how…


You cannot create multiple System.Management.Automation runspaces in a web application for two or more different users if you use implicit credentials

Update: This information has been published as a KB article: https://support.microsoft.com/en-gb/kb/3115600. When you try and allow multiple users to create System.Management.Automation runspaces in a web application, if you are using implicit credentials (i.e., credentials from impersonation), you will notice that only the first user that accesses the web application is able to call CreateRunspace.  All…

0

PowerShell: Remove duplicate items from a mailbox

I’ve extended the script I posted a few months ago so that now it can search for duplicate contacts and email items (not just appointments).  I’ve posted the script to the Office Developer Centre, and rather than having to maintain two pages, I’ll just leave a link here: https://code.msdn.microsoft.com/exchange/PowerShellEWS-Remove-54228d71 Any new code samples will be…


PowerShell: Update folders (delete/purge, or add/delete properties)

Please note: the script has now been moved to https://code.msdn.microsoft.com/PowerShell-Update-mailbox-1e17866d. This script allows you to update folders by adding or removing properties.  You can also use the script to purge or delete the folders. To delete properties from a folder: .\Update-Folders.ps1 -Mailbox 1@e14.local -FolderPath “\Folder 1” -ProcessSubFolders -DeleteFolderProperties @(“0x36160102”, “0x36DA0102”) In the above example, MAPI properties…


PowerShell: Search for appointments

You can use the Exchange cmdlet Search-Mailbox for a wide variety of searches, but it does have some limitations.  Attached here is a PowerShell script that uses EWS to search appointments, and as the script uses both server and client side search it can be used to performs searches that aren’t possible with Search-Mailbox (and…


PowerShell: Remove duplicate calendar appointments

We regularly get requests for an automated way of deleting duplicate appointments from calendars (most often caused by migration issues or mistaken mailbox imports, but there are lots of reasons that you could end up with duplicates).  So, here is a script that checks for and deletes duplicates.  As usual, it uses EWS to connect…