Skip to main content

Posts

Showing posts from November, 2014

Advanced Search Folder creation with EWS and Powershell

In the past I've posted some examples of creating SearchFolders in Exchange with EWS and Powershell in the following post ,  in this post I want to cover some more advanced things you can do with EWS and Search Folders. The first thing I want to cover is how you change the option on a Search folder from "Show number of unread items" which is the default when you create a search folder in EWS to "Show total number of items". eg To change this option you need to set the PidTagExtendedFolderFlags property which is documented in http://msdn.microsoft.com/en-us/library/office/cc839880(v=office.15).aspx  . This is a binary property and you set this particular option by changing bit 6-7 in this property. Because you also need the SearchFolderGuid in this property the easiest time is to set this is right after you create the folder. eg $searchFolder .Save( $sfRoot .Id);   $PR_EXTENDED_FOLDER_FLAGS  = new-object Mic...

Creating a new folder in EWS and add it to the MyContacts list in OWA in Exchange 2013/Office365

The peoples hub is one of the new features in Exchange 2013 and Exchange Online that is aimed at making your life richer. One little quirk if your creating new folders using EWS is that they won't appear in the My Contacts list inOWA eg if I was creating a folder named aNewContactsFolder you would get To make the new Folder you just created appear in the MyContacts list rather then other contacts you need to set these two yet to be documented properties PeopleHubSortGroupPriority  PeopleHubSortGroupPriorityVersion Setting the value of these two named properties to 5 and 2 respectively will make the folder appear under My Contacts, if you want to move the folder into other contacts set the values to 10 and 2 Here's a sample script to create a New Folder as a subfolder of a Mailboxes Contacts Folder and set these two properties so the Contact Folder appears under MyContacts To run the script pass the emailaddress of the mailbox you want...
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.