Skip to main content

Posts

Showing posts from January, 2008

Setting and Understanding Folder Permissions in Exchange Web Services

One of the more challenging things you may want to do when writing code that is going to run against an Exchange 2007 mailbox is to set and modify Folder permissions on a mailbox folder or a public folder. I’d thought I’d share my efforts and what I learnt over the last week of trying to do this (thanks to David Claux for helping me get over my issues with custom permissions). One of the features added to SP1 in Exchange 2007 is the ability to set folder permissions and also folder delegates. This is a pretty cool feature but one you do need to make sure you understand before you dive in. Before you start its a good idea to understand the permissions your want to modify to ensure your code is going to work as expected and avoid any unwanted ACL changes. Let’s start by looking at the permissions that can be set on a folder via EWS CanCreateItems ReadItems DeleteItems EditItems CanCreateSubFolders IsFolderContact IsFolderOwner IsFolderVisible Wi

Making use of Autodiscovery in VBS and Powershell Scripts

Auto discovery is one of the new features that are trying to alleviate some of the pain of configuring and maintaining Outlook client setting. Once you have managed to overcome the SSL configuration peculiarities you have a nifty little service that you can authenticate against, supply it with your email address and it will inform you about everything you need to know about connecting to exchange using Outlook, OWA, EWS and or any of the other new services Exchange 2007 provides. If you’re a scripter the information the auto discovery service provides can be retrieved via Active Directory but it not that easy and certain not as convenient as doing with one request. The scripts I’ll talk about in this post are designed to be run from workstation where the Exchange Management Tools aren’t install so they won’t be using any of the Exchange Management Shell cmdlets. The first thing you need to do if you want to use Auto discovery is query Active Directory for the Service Connection Poin

Exporting the OOF (Out of Office) Setting for every user on a server using CDO 1.2 and VBS

This is another one that came out of the Ether the Out of office functionality was one of the things that received a welcome makeover with Exchange 2007 / Outlook 2007. If you’re moving, migrating or just wondering if people are actually using the Out of Office Assistant then this might be the script for you. This script is broken down into 2 parts the first part of the script takes one command line parameter which is the name of the server you want to export the information from and then it does a ADSI query of Active Directory to get the detail of every account on the server in question. The second part of the script connects to each of the mailboxes the ADSI query found and looks to see if the oof setting is enabled. One of the good things about CDO 1.2 is that it makes getting and setting the oof setting on a mailbox very simple basically once you have logged on you can pull the oof setting from the outofoffice and outofofficetext property of the session object. The format this scr

Finding the number of Unread Voicemail Messages in a Mailbox

One thing that you can be sure to expect to see more in the future is richer types of messages arriving in your inbox one example of this is Voice Mail Messages in Exchange 2007. The interesting thing about this is the way this changes the dynamics of a simple thing like the unread message count in your mailbox. For example how do you now balance the priority of a voice message to that of email message eg which one do you read first (or listen to first). How do you weigh the contents of a voice message to that of a text message and if your away for a longer period of time and amass a larger number of voice and email message in your mailbox can you really get away with just marking them all as read. Okay maybe I can’t reengineer the space time continuum with this post to solve this but I can show a few ways of show how many unread voicemails you have in a mailbox. The usually way of getting the unread message count on your inbox is just to use the unread property of the mailbox

Adding your own X-header when sending a message via Exchange Web Services

Thought this was worth a post its something that pretty easy to do with EWS but not something that maybe initially obvious. If you want to add an X-header to a message your sending via Exchange you need to add this via the PS_INTERNET_HEADERS namespace. With EWS you do this when using the MessageType class by adding an Extended property. Eg if you take the basic send message via EWS example from MSDN http://msdn2.microsoft.com/en-us/library/bb408521.aspx and all you need to do is add the following to add your own custom X-header message.Sensitivity = SensitivityChoicesType.Normal; // Start X-header Code PathToExtendedFieldType epExPath1 = new PathToExtendedFieldType(); epExPath1.DistinguishedPropertySetId = DistinguishedPropertySetType.InternetHeaders; epExPath1.DistinguishedPropertySetIdSpecified = true; epExPath1.PropertyName = "x-myheader"; epExPath1.PropertyType = MapiPropertyTypeType.String; ExtendedPropertyType xhXheaderProp = new ExtendedProper
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.