PowerShell: Batch moving/merging mailboxes

The Merge-MailboxFolder script is very powerful in that it can move data between mailboxes (even entire mailboxes, if desired).  It can also be used to process lots of mailboxes at once.  This blog post is going to run through in detail the procedure to move all items from the archive mailbox into the main mailbox…


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…


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…


EWS: Update Out-of-Office (OOF) sample application

This sample program shows how the OOF message can be manipulated using the EWS Managed API.  Full source (Visual Studio 2013) is included, and the program can be run from the command-line (so can be incorporated into scripts) or with UI.  When run from the Visual Studio IDE, the UI will be shown and any…


Exchange Web Services and SharePoint 2013 without ApplicationImpersonation

I previously wrote an article showing how to set up Sharepoint 2010 to be able to access users’ mailboxes using EWS and integrated authentication (i.e. no service account was needed for the EWS calls).  Things have changed with Sharepoint 2013, so this article details the process with the latest versions of the products (at the…