Skip to main content

Posts

Showing posts from October, 2013

Creating a Shared Calendar Shortcut (WunderBar Link) with EWS and Powershell

Shared Calendar Shortcuts eg are an Outlook and OWA  feature that can be handy to automate if you need to deploy a number of these to new (or existing) mailboxes and you don't want to go through the invitation/accept procedure or manually adding each shortcut. While there are no supported operations in EWS for creating these type of objects, it can be achieved by setting the Extended MAPI properties that constitute the shortcut. The downside of this is that it wouldn't ever be considered supported if it all goes horribly wrong. The properties involved in the shortcut are documented in the following protocol document http://msdn.microsoft.com/en-us/library/ee157359(v=exchg.80).aspx . For a couple of these properties the values you need to get can't be obtained directly in EWS so some others tricks are needed. The PidTagWlinkAddressBookEID property contains the MAPI address Book EntryId for the shared Calendar your connecting to. The Address Book EntryID format is

Exporting the Suggested Contacts, OWA Auto-complete Cache and Recipient Cache in Exchange 2013 with EWS and PowerShell

The following script creates a CSV export of Automatically generated contacts that have been saved in any of the 3 following auto contact locations Suggested Contacts Folder which is Outlook feature that automatically creates a Contact for each address you send an email to -  http://office.microsoft.com/en-au/outlook-help/automatically-add-contacts-for-everyone-that-you-send-an-email-message-HA101874367.aspx OWA Autocomplete Cache - This is OWA version of the NickName cache, its stored in a UserConfiguration object in the Root of the Mailbox. The Addresses are stored inside an XML Streaming Property. Recipeints Cache Folder - This is a new Exchange 2013 folder which is a hidden sub folder of the Contacts folder with a mailbox and it's purpose isn't really documented at the moment, but contains like the AutoComplete cache,  Addresses for Sent Emails. So this script just create a CSV file with the Source, DisplayName and Email-address of any entries from these 3 locations

Parsing out URL's in the body of a Message with EWS and Powershell

Sometimes when your writing an Automation script you might want to parse a certain URL from the Body of a Message. One example would be the Lync Meeting URL from an Online Meeting invitation or another might but a DropBox URL for a shared file. To grab the Body of a Message in the EWS Managed API you need to use either Load() or LoadPropertiesForItems() if you have a number of messages your processing. Using these methods will do a GetItem (or batch GetItem) in EWS. To parse the URL's from the HTML body markup that EWS returns you can use some RegEx to separate out all the links. Then you can use the URI class from .net to parse the matches further and identify the hosts in the URL to see if its the URL your looking for. The following sample will loop through the last 100 emails in a mailbox's and parse any Lync Meeting URL's (for Office365) or Dropbox URL's. I've put a download of this script here The code looks like ## Get the Mailbox to Access f
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.