Skip to main content

Posts

Showing posts from May, 2012

EWS Managed API and Powershell How-To Series Part 9 EWS Notifications

In this installment of the how-to series I'm going to cover EWS notifications which are a mechanism you can use to find out when changes occur in an Exchange Folder. One critical point when thinking about notifications is you need to think of them as notifications and not the programmatic equivalent of events which event sinks where (kind of). Exchange is a mail system that caters to many clients and applications and from a client sense (not a throttling sense) all of these clients are even. So when your building a notification application that is going to affect a message in some way(eg say your just moving it to another folder) you need to understand that by the time your application has received the notification another application may have taken an action on that message. The other issue you may have is because there can be so many clients involved and different synchronization methods in use is you may get multiple notifications for one item which is an issue you just need to

How To Series Sample 6 : Show a sorted list of Subject's and number of messages within a mailbox

The following script shows how you can create a summary report of the Subjects of all Messages within a Mailbox. It makes use of the PR_NORMALIZED_SUBJECT http://msdn.microsoft.com/en-us/library/cc815282.aspx . property which contains the subject of a message minus the prefixes such as RE, FW etc. The end result is it will pump out a sorted list of the Number of messages per subject and also create a CSV report. The script is designed to work on Exchange 2010 but you could make it work on 2007 as well by converting the AQS QueryString (which limits the finditems call to just Email) to a search filter. I've put a download of this script here the script looks like $RptObjColl  = @()   $MailboxName  =  "user@domain.com"       ## Load Managed API dll      Add-Type -Path  "C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll"           ## Set Exchange Version      $ExchangeVersion  = [Microsoft.Exchange.WebServic

EWS Managed API and Powershell How-To Series Part 8 Folder Permissions

In this series so far I've covered a lot of ground in EWS covering all the everyday operations so its time now to look at some of the more interesting and useful things you can do. Folder permissions are one thing that can both affect the code you run if you don't have the correct or enough rights in a folder your accessing and are also something you may want to manage using EWS. As before in this series I should point out that folder permission can be managed within the Exchange Management Shell using the Get and Set-MailboxFolderPermissions cmdlets and this can be a better solution for managing permissions. Exchange Folder permission in a netshell Exchange uses the normal discretionary access control list (DACL) with Access Control Entries (ACE's) to control access to its resources but there are a few special things to keep in mind. (There are also SACL's on public folders which you can't set from EWS). Special ACE's in the Folder DACL : There are two s
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.