Skip to main content

Posts

Showing posts from January, 2014

Accessing a User's Shared Contacts Folders in EWS

A while back I posted a sample of creating a Shortcut to a Shared Calendar folder using EWS here  . In this post I'll look at how you can do the inverse which is reading and accessing the folders associated with these shortcuts. A users Shared Contacts folder's will appear like the following in Outlook These Shortcuts are special items that are saved in the Common Views folder in the Non_IPM_Subtree of a mailbox. The data for the shortcut item is saved in a number of properties which are documented in the following Exchange protocol document  http://msdn.microsoft.com/en-us/library/ee157359(v=exchg.80).aspx So to access these shortcuts from EWS requires a few different operations, the first is you need to use a FindFolder operation on the Root of the Mailbox to located the CommonViews Folder. Once you have the CommonViews FolderId you then use the FindItems operation to find any of the Items where the PidTagWlinkGroupName  is set to Shared Contacts, which will effectivel

Paging eDiscovery results with the EWS Managed API in Exchange 2013

eDiscovery is one of the new features in Exchange 2013 aimed at both improving the search experience and also helping deal with Big Data in a mailbox or mailboxes (which is kind of like the Sun in that its just keeps getting bigger and will one day consume us all). With eDiscovery in EWS you can perform two types of searches a Estimate Query - Which will return information about the number of hits for a particular KQL query. Preview Query - Will return your query hits as PreviewItems which you can then use to show more information about each hit. If your doing a Preview Query with a very generic search predicate that is going to be returning many preview Items and because of the size of these results they will returned as separate paged results sets. This will mean you will need to make multiple search requests to navigate thought the result set pages. To tell the server you want the next Page in the Results set you need to use the  PageItemReference   . The PageItemReferenc

Create a Public Folder (or Mailbox folder) Post using EWS and Powershell

Somebody asked a couple of weeks ago about creating Post Items using EWS and Powershell which I haven't posted a sample for previously. Given its the first day of the year an example of a post about how to create a post to wish everybody happy new year seems like good idea. Creating a POST item using the EWS Managed API is pretty straight forward as their is a PostItem Class you can use. To create a post is a folder you just need to know the ewsID of the folder you want to create the POST in. So in EWS you need some code that will either search and find the Folder in the Mailbox you want to post to or the Public Folder you want to post to.  I've created two sample one show how to create a post in Mailbox folders and the other in a Public folder. I've posted a download of the two sample here . The code for creating a POST in a Public folder looks like ## Get the Mailbox to Access from the 1st commandline argument       $MailboxName  =  $args [0]      ## Loa
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.