Skip to main content

Posts

Showing the client that was used to create or update an Appointment in Exchange 2013/16 using EWS

Previously I posted an example on Mining the Client information on Sent Messages in EWS to report on what client is being used in this post . For Calendar appointments there is a simular but different property that gets set when you either create or update a Appointment eg (This property is set by the Exchange Store based on what client is being used)  I've put together a script that aggregates this property and produces a summary report like Its also produces an export report of all the appointments that looks like the following so you can see at the appointment level what client is being used. I've put this script up on GitHub here https://github.com/gscales/Powershell-Scripts/blob/master/ShowCalendarClients.ps1

EWS Basics : Create a Folder in a Mailbox or Public Folder

One of the more common questions on EWS I get is around how to create a folder so this post will cover the basics you need to know around creating folders using EWS in Mailboxes or Public Folders. What you need to create a Folder To create a folder you first need a unique name for the new folder eg if you going to create a folder called "SubFolder1" under the Inbox another folder with the name Subfolder1 can't already exists as a SubFolder of the Inbox (anywhere else in the Mailbox is okay) if it does you will get an error.  So when writing a script to create a folder its first good to includes a search to see if the folder already exists. eg #Define Folder Veiw Really only want to return one object $fvFolderView = new-object Microsoft.Exchange.WebServices.Data.FolderView(1) #Define a Search folder that is going to do a search based on the DisplayName of the folder $SfSearchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqu...

EWS Bascis : Accessing Public Folders and Public Folder Content

As well as Mailboxes and Archives, Public Folders are another place you may want to use EWS to enumerate Items to do some enhanced reporting. Building on the Enumerate script from the last two post, this post will cover how to modify this script to enable access Public Folder and Public Folder Items. EWS Changes To change the Mailbox code we have to access public folders requires one big change in the Mailbox script we have the line $folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId( [Microsoft.Exchange.WebServices.Data.WellKnownFolderName] :: MsgFolderRoot, $SmtpAddress ) in the FolderIdFromPath function. To access a Public folder we need to change this to $folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId( [Microsoft.Exchange.WebServices.Data.WellKnownFolderName] :: PublicFoldersRoot) And that's pretty much it apart from renaming the function to PublicFolderIdFromPath this is all you have to do. One thing you can't do ...

EWS Basics : Reporting on the Age of Items in a Folder

One of the more common questions I get is around some of the EWS Item Age scripts I've written in the past. If we take the script I introduced in the first Basics post with some easy modifications we can turn this script that already enumerates all the Items in a folder into a script that will report on age of the Items in a folder. So in this post I'm going to try to explain a little better the changes that you would need to make. EWS Changes The EWS changes that need to be made to the basics script are to the Propertyset that is used in the FindItems Operation. A PropertySet in EWS basically tells Exchange which properties you want to be returned. So to make this script as efficient as possible we want to restrict Exchange to just returning the Size and DateTime the messages where received or created. So these are the only changes that are needed for the EWS side $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000) $ItemProps...

EWS Basics : Enumerating all the Items in any folder in a Mailbox

I've decided to start a new series on the blog called EWS Basics where I'll post some reusable scripts that are fit for easy customization by those people unfamiliar with EWS. So the basic idea is to have a group of samples where most of the underlying EWS plumbing code is done and you can just plug in whatever customized action you want to do on particular Items Enumerate all the Items in any folder in a Mailbox A common task when you want to report on the Item content in a Folder or you want to perform some type of action on Items (Delete,Move,Copy etc) is you will want to enumerate all the items in a folder. One analogy is doing a dir on directory (just don't mention the M: drive!) So what this sample does is lets you input the MailboxName (PrimarySMTP Address) and Path to the Folder in the mailbox where the Item are  you want to access and it will write back to the pipeline the Items it finds. So to put that together in a sample say you wan...

Conversation statistics with EWS

Conversations have been a hot area in the Messaging space recently with many different solutions jockeying for attention such as Yammer, Office365 Groups , Slack, HipChat, Skype for business and many other. Each solution offers a different method to communicate and thread different conversations in different ways  over different clients and communication platforms. Typically in Exchange conversations either take place in Mailboxes or Public folders while Groups are a now a newer offering. When it comes to reporting, looking at conversations can offer some interesting insights as to when conversations are happening how many people are participating and where a Group or Channel based solution might provide some form of productivity gain or usefulness. In EWS in Exchange 2010 and greator the findconversation operation allows you to query and group conversation threads in a Mailbox folder and you can then use the information returned about the co...

Mining the clientinfo property in Messages in Exchange 2013 and Office365 with EWS

Tracking the bewildering array of clients and different Internet browsers that are being used to send email on Exchange can be an interesting challenge especially when your clients are in the cloud. One Mapi property that gets set on the SentItem in the senders Mailbox can help answer some of these questions where logs may not be available. The Named Mapi property clientinfo eg So if you write a script that accesses this property on messages in the SentItems folder you can build a report of the different sending methods that are being used and also different properties such as the browser version from the agent string being stored eg something like this I've put a script on GitHub here https://github.com/gscales/Powershell-Scripts/blob/master/GetMailUserAgentsv2.ps1  that can mine the data in the property correctly taking into account the ; used as a separator while also dealing with data enclosed in ( ) (it does this by just doing a characte...
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.