Skip to main content

Posts

Showing posts from July, 2009

Setting single line view in OWA for a folder via Powershell using the EWS Managed API

Early this year i posted a script for turning the reading pain off and on in OWA 2007 using some EWS proxy code in powershell. The same thing can also be done using the EWS Managed API as well as other properties in OWA like the single line view which someone asked about this week. So here is a script that can be used for setting both of these values. Single Line View property, Like the reading pain this OWA setting in controlled by a property that is set on each folder http://schemas.microsoft.com/exchange/wcmultiline To use this in Powershell in the EWS Managed API you need to define a Extended Property using the Public Strings PropertySet eg $wcmultiline = New-Object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition([Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet]::PublicStrings," http://schemas.microsoft.com/exchange/wcmultiline ", [Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Boolean); 1 = True mean multiline view is On (Default) 0

Creating Sticky Notes in the EWS Managed API from Powershell

I’m a big user of sticky notes in Outlook and I’m always finding different ways to have fun with them. The EWS Managed API makes creating them relatively simply from powershell as long as you have got a handle on the extended properties that are being used to control the Sticky Notes as well the method of creating objects with different Item class in EWS. Because there are no specific objects within EWS Managed API to help create Sticky notes you need to use a EmailMessage object and change the ItemClass to “IPM.StickyNote”. You also need to set a number of Extended property which control the color and size of the sticknote object. The following sample creates a sticky note in the currently logged on users mailbox I’ve put a download of the code here the code itself looks like $dllpath = "C:\Program Files\Microsoft\Exchange\Web Services\1.0\Microsoft.Exchange.WebServices.dll" [void][Reflection.Assembly]::LoadFile($dllpath) $service = New-Object Microsoft.Exchange.WebService
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.