EMEA Developer Support for Messaging Team Blog

Messaging Developer code samples and documentation

Browse by Tags

Tagged Content List
  • Blog Post: PowerShell: Setting the global reading pane view in OWA

    Attached is a script that can be used to update the global reading pane view for OWA, and can be run against multiple mailboxes from PowerShell. It requires the EWS Managed API to be installed on the client machine, and if running against multiple mailboxes you'll need to grant impersonation rights to...
  • Blog Post: How to clear SIDHistory and keep mailbox permissions

    The SIDHistory attribute of a user object is used to store old SIDs for that user (usually SIDs from other domains when the user is migrated). In some cases, over time, this attribute can hold lots of values (every time a user is migrated, the previous SID is added to the list), and we sometimes get...
  • Blog Post: PowerShell: Clean Mailbox Delegates (update)

    I wrote a script a while ago that can remove invalid delegates from a mailbox using a mixture of EWS and Exchange PowerShell. The limitation of the original script is that is didn't do anything about the hidden rules that forward messages to delegates, which means that the unexpected NDR issue (as described...
  • Blog Post: EWS: Missing SOAP headers when using the EWS Managed API

    We’ve recently had a few cases where some SOAP headers were missing from the request when performing specific operations and targeting specific Exchange versions. This resulted in incorrect data being returned. For example, if you Target Exchange2010 or higher and wish to reply to or forward an EmailMessage...
  • Blog Post: PowerShell Automation from .Net

    Even though this blog has numerous PowerShell scripts showing mainly how to use EWS from PowerShell, scripting isn't actually something my team supports (Exchange scripting support is provided by the Exchange team). What we do support, though, is automation of PowerShell from .Net. We've had a couple...
  • Blog Post: EWS: Performance issues when accessing multiple mailboxes?

    We've had a few cases come through over the past few months regarding slow performance against Office Online from an EWS service application. Several of them have come down to a very simple .Net setting that isn't necessarily obvious. In fact, I first hit the issue myself when creating a streaming notification...
  • Blog Post: PowerShell: Create folders in users' mailboxes

    Here is a PowerShell EWS script that will create folders (one or more) in users' mailboxes. To run it against a single mailbox, syntax is: .\Create-Folders.ps1 user1.ex2k7@hybrid.local "Folder 1;Folder 2" By default, folders are created under the inbox. For multiple folders (as above), separate...
  • Blog Post: PowerShell: Purge folder of items over a certain age

    This PowerShell script can be used to purge a folder of its contents, optionally only deleting items before a certain date. Example usage: .\Purge-MailboxFolder user1.ex2k10@hybrid.local "Test Folder" "02/Aug/2013" -Impersonate -SearchForFolder The above will search for the first folder called...
  • Blog Post: PowerShell: Search public folders for items of a particular message class (ItemClass)

    In addition to the mailbox search script , I have also written a sample script showing how to do the same search against public folders. It works in exactly the same way, but iterates public folder tree instead of the mailbox. The EWS Managed API needs to be installed on the machine running the script...
  • Blog Post: PowerShell: Search mailbox for items of a particular message class (ItemClass)

    The Search-Mailbox cmdlet can be used to perform various searches within a mailbox, and while it serves many needs, there are some searches that it can't do. I wrote a PowerShell script to demonstrate how to perform a search of a mailbox (or mailboxes) using EWS, in this case looking for items of a particular...
  • Blog Post: EWS: Streaming Notifications and Exchange 2013 (and Office 365 Wave 15)

    Exchange 2013 introduced a new affinity model which means that streaming subscriptions to multiple mailboxes need to be handled in a different way to earlier versions. If you are connecting to a single mailbox, you shouldn't have a problem, but you most likely will encounter issues if you are connecting...
  • Blog Post: EWS: Hide a named folder in multiple mailboxes

    Recently we've had a couple of requests that involved deleting or hiding mailbox folders that are created automatically either by Outlook or Lync. Deleting such folders is usually both not supported and also not possible - they will most likely be marked as distinguished folders, which means that they...
  • Blog Post: EWS: Streaming Notification Sample

    To complete my unintentional series on EWS notifications, I have written a sample application showing how to deal with streaming subscriptions. The application includes full logging of both events and EWS calls, so is very useful for troubleshooting. The screenshot below shows the application in action...
  • Blog Post: EWS: Push Notification Sample

    I wrote a sample application quite a while ago showing how to write a push notification client using WCF. This seemed a little complex to me, and I have now got another sample that uses the managed API and a custom listener (taken from SOAPTestApp ) to respond to the notifications. The listener form...
  • Blog Post: PowerShell: Set Calendar folder delegate permissions in Exchange 2007

    Exchange 2010 has cmdlets ( Add-MailboxFolderPermission , Set-MailboxFolderPermission ) that allow an administrator to update folder permissions on a user's calendar. Unfortunately, Exchange 2007 does not have these cmdlets. We recently had a case that required updating many mailboxes (in this case resource...
  • Blog Post: PowerShell: Clean mailbox delegates

    An updated version of this script (that also handles the hidden forwarding rule) is available here: http://blogs.msdn.com/b/emeamsgdev/archive/2014/05/16/powershell-clean-mailbox-delegates-update.aspx Granting delegate access to a mailbox stores the permission on the mailbox to which the permission...
  • Blog Post: EWS from a Web Application using Windows Authentication and Impersonation

    To augment an earlier blog post that describes how to use EWS in a SharePoint webpart without needing ApplicationImpersonation, here I will go through the steps needed to do this from a standard web application. The scenario is that a web application (hosted on a standalone application server) needs...
  • Blog Post: PowerShell: Remove invalid delegates from mailboxes

    We recently had a case where there were invalid delegates on a mailbox and these were causing further issues (which aren't important with regards to this blog!). Invalid delegates can come about when mailboxes and users are deleted from an organisation. The reason for this is that delegate permissions...
  • Blog Post: Exchange Web Services and SharePoint without ApplicationImpersonation

    A question that I have seen crop up quite a bit on the internet is how to use EWS with a SharePoint webpart. Using EWS is quite easy, as you can simply reference the managed API and use that - but the main implementation headache is how to set up authentication. A lot of customers do not want to use...
  • Blog Post: PowerShell: Script to set holiday status to busy (or OOF, free, etc.)

    As you may or may not know, Outlook has a facility to import known public holidays. However, currently while these holidays will be imported into the Outlook calendar, the status of these holidays is set to Free. An often received request is for advice on how to change this status to Busy, or OOF. If...
  • Blog Post: EWS Managed API: How to remove Email1, Email2, Email3 from a contact

    An interesting case recently asked how to remove Email1, Email2, and/or Email3 from a contact using the EWS Managed API. If you try to set any of these properties to null, or an empty string, then you will receive an error when sending the request to Exchange (i.e. when you call Update()). There are...
  • Blog Post: How to change the default item type of a folder (VBScript and OOM, or EWS)

    It is possible to change the default item type of Outlook folders, and this is commonly done when custom forms are being used. The question came up recently asking whether it is possible to do this programmatically, and it certainly is. The default item type of a folder is stored in a single MAPI...
  • Blog Post: Exchange 2010, EWS, Autodiscover and the MAPIEnabled property

    Recently we had a case come in whereby a customer was having problems connecting to a mailbox using EWS against a Live@Edu mailbox. There were a few interesting points that came up during investigation of this case. In the first instance, we only support using Autodiscover with EWS to access any cloud...
  • Blog Post: PowerShell: Script to move items from one folder to another in a user's mailbox

    Manipulation of mailbox items is not something that is really available using Exchange cmdlets - understandably, as Exchange PowerShell is for administration of the Exchange environment rather than manipulation of mailboxes themselves. Of course, PowerShell itself offers all the features needed to be...
  • Blog Post: PowerShell: Script to recover all deleted items in a mailbox

    We had a request recently for a sample PowerShell script that shows how to recover deleted items from and Exchange 2010 mailbox. While not possible (as far as I am aware) using any standard Exchange cmdlets, it is certainly possible using the EWS Managed API. The script has been written so that it...
Page 1 of 2 (35 items) 12