This was posted in microsoft.public.windows.powershell: Subject: "Change MessageClass on Incoming e-mails in a Shared Mailbox" Text:"We have a shared mailbox that recives normal IPM.Note mail - We would like to change that. We are running Exchange 2007 SP1. Understand that PowerShell is the way to go for this - Where can I find examples on how to build and install this kind of scripts." I tried doing some digging, and am curious... Are there any online references to Exchange 2007 "eventing"? This is likely an API, but I can't seem to come up with any search results... Marco
Powershell wont really help with this one you'll need to use one of the Exchange API's to do this there are a few options 1. You could write a Transport Agent and change the message while its in the transport Pipeline the message class is a bit of a special property but you can change it using the TNEF writer see http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1381211&SiteID=17 . Using the TNEF writer isn't the easiest thing in the world but this is the method that i would recommend using. 2. You could write a Notification application using Exchange Web Services basically you subscribe to the new mail notifications in the Folder and then your application connects back to the Mailbox and can change the item in question. The problem you have here is that notifications are Asynchronous so you will receive the notification after the mail has arrived. Your notification app is just another client in this instance so there's no guarantee that it will get to the message first before any of the other clients you have connecting to the mailbox. 3. You could write a Exoledb Event Sink. Exchange Store Events sinks have been deemphasised in 2007 (so probably wont be their in the next version) but they are still fully functional. eg you can create a onsyncsave event sink and register it on the inbox of the mailbox in question and it can be used to change the message class. All the information you need is in the Exchange SDK which you can grab from http://msdn.microsoft.com/exchange Cheers Glen "Marco Shaw [MVP]" wrote in message news:uMRSVoEZIHA.5612@TK2MSFTNGP06.phx.gbl... > This was posted in microsoft.public.windows.powershell: > > Subject: "Change MessageClass on Incoming e-mails in a Shared Mailbox" > > Text:"We have a shared mailbox that recives normal IPM.Note mail - We > would like to change that. We are running Exchange 2007 SP1. > Understand that PowerShell is the way to go for this - Where can I find > examples on how to build and install this kind of scripts." > > I tried doing some digging, and am curious... Are there any online > references to Exchange 2007 "eventing"? > > This is likely an API, but I can't seem to come up with any search > results... > > Marco
Glen Scales [MVP] wrote: > Powershell wont really help with this one you'll need to use one of the > Exchange API's to do this there are a few options Thanks for the detailed reponse. However I did notice a PowerShell cmdlet that *might* help. I'm not familiar enough with Exchange... The cmdlet new-managedcontentsettings has a messageclass parameter: "-MessageClass <String> The MessageClass parameter specifies the message type to which any expi ration and journaling configuration settings within these content settings apply. The parameter value can be a well-known message type such as Calendar I tems or a specific message class such as IPM.NOTE.SMIME. Well-known message types are as follows: * All Mailbox Content * Calendar Items * Contacts * Documents * Faxes * Journal items * Meeting Requests, Responses, and Cancellations * Notes * Posts * RSS Items * Tasks * Voicemail Specific settings supersede general settings. For example, Voice Mail supersedes All Mailbox Content." I wasn't able to figure out exactly how to use it. Primarily, how to have it reference a public folder. I'll keep searching in my spare time... Marco
No that wont help this just controls journaling and expiration on Managed folders this wont affect the actually content. At the end of the day you have mail coming into an inbox there is no configuration you can change that will change the message class. You have the force the change via one of the Exchange API's or just have the source that sends the mail set it in the first place. One last option I've just thought of and probably the easiest to implement because it doesn't require you to code anything and its something you could use from a script is to use a Server side rule on the inbox in question. There is an option with rules to set a Mapi property you can do this with the rule.dll and cdo 1.2 in VBS (it wont work in powershell because of the way CDO 1.2 threads) or you could use RDO from Redemption which will work fine from Powershell. Its look like Dmitry has already got a sample there to do what you want have a look at http://www.dimastr.com/redemption/rdo/rdorule.htm (this sample in the tag property) Cheers Glen "Marco Shaw [MVP]" wrote in message news:OkSLQ7QZIHA.4332@TK2MSFTNGP04.phx.gbl... > Glen Scales [MVP] wrote: >> Powershell wont really help with this one you'll need to use one of the >> Exchange API's to do this there are a few options > > Thanks for the detailed reponse. However I did notice a PowerShell cmdlet > that *might* help. > > I'm not familiar enough with Exchange... The cmdlet > new-managedcontentsettings has a messageclass parameter: > > "-MessageClass <String> > The MessageClass parameter specifies the message type to which any > expi ration and journaling configuration settings within these content > settings apply. > The parameter value can be a well-known message type such as Calendar > I tems or a specific message class such as IPM.NOTE.SMIME. Well-known > message types are as follows: > * All Mailbox Content > * Calendar Items > * Contacts > * Documents > * Faxes > * Journal items > * Meeting Requests, Responses, and Cancellations > * Notes > * Posts > * RSS Items > * Tasks > * Voicemail > Specific settings supersede general settings. For example, Voice Mail > supersedes All Mailbox Content." > > I wasn't able to figure out exactly how to use it. Primarily, how to have > it reference a public folder. > > I'll keep searching in my spare time... > > Marco
> There is an option with rules to set a Mapi property you can do this with > the rule.dll and cdo 1.2 in VBS (it wont work in powershell because of the > way CDO 1.2 threads) or you could use RDO from Redemption which will work Any references to this "CDO 1.2 threading issue"? It have to do with the ApartmentState? Marco
I dont remember the full details but just try using it and you'll find out, CDO 1.2 has never been supported in .NET http://support.microsoft.com/kb/813349 if you want to use CDO its a much better idea to use VBS. Your basically only using the script to create the rules anyway. Cheers Glen "Marco Shaw [MVP]" wrote in message news:OYjJ2MUZIHA.4172@TK2MSFTNGP02.phx.gbl... > >> There is an option with rules to set a Mapi property you can do this with >> the rule.dll and cdo 1.2 in VBS (it wont work in powershell because of >> the way CDO 1.2 threads) or you could use RDO from Redemption which will >> work > > Any references to this "CDO 1.2 threading issue"? It have to do with the > ApartmentState? > > Marco
See http://ivasoft.com/cmclass2007.shtml Regards, Victor Ivanidze "Marco Shaw [MVP]" wrote in message news:uMRSVoEZIHA.5612@TK2MSFTNGP06.phx.gbl... > This was posted in microsoft.public.windows.powershell: > > Subject: "Change MessageClass on Incoming e-mails in a Shared Mailbox" > > Text:"We have a shared mailbox that recives normal IPM.Note mail - We > would like to change that. We are running Exchange 2007 SP1. > Understand that PowerShell is the way to go for this - Where can I find > examples on how to build and install this kind of scripts." > > I tried doing some digging, and am curious... Are there any online > references to Exchange 2007 "eventing"? > > This is likely an API, but I can't seem to come up with any search > results... > > Marco