exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exchange 2007 eventing

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development
Author Message
Marco Shaw [MVP]



Joined: 13 Oct 2007
Posts: 4

PostPosted: Thu Jan 31, 2008 9:44 pm    Post subject: Exchange 2007 eventing Reply with quote

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

Archived from group: microsoft>public>exchange>development
Back to top
View user's profile Send private message
Glen Scales [MVP]



Joined: 05 Aug 2007
Posts: 92

PostPosted: Fri Feb 01, 2008 8:12 pm    Post subject: Re: Exchange 2007 eventing Reply with quote

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 @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
Back to top
View user's profile Send private message
Marco Shaw [MVP]



Joined: 13 Oct 2007
Posts: 4

PostPosted: Fri Feb 01, 2008 9:12 pm    Post subject: Re: Exchange 2007 eventing Reply with quote

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
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
Back to top
View user's profile Send private message
Glen Scales [MVP]



Joined: 05 Aug 2007
Posts: 92

PostPosted: Sat Feb 02, 2008 3:32 pm    Post subject: Re: Exchange 2007 eventing Reply with quote

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 @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
> 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
Back to top
View user's profile Send private message
Marco Shaw [MVP]



Joined: 13 Oct 2007
Posts: 4

PostPosted: Sat Feb 02, 2008 3:27 am    Post subject: Re: Exchange 2007 eventing Reply with quote

> 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
Back to top
View user's profile Send private message
Glen Scales [MVP]



Joined: 05 Aug 2007
Posts: 92

PostPosted: Mon Feb 04, 2008 2:02 am    Post subject: Re: Exchange 2007 eventing Reply with quote

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 @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

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Exchange 2007 SP1 SDK Hi all, I installed a few days ago Exchange 2007 SP1 SDK on 64-bit machine with 64-bit Exchange 2007 installed. I wanted to learn how transport agents for Exchange 2007 work. So I built, installed and started an SDK sample named However,

Exchange 2007 and WebDAV Hi, I have an application that talks to Exchange using WebDAV. It seems to break at some customer sites because the URL seems to be instead of What do I need to change on the exchange server to repli

Exchange 2007 Web Service, get new emails I started with the Exchange 2007 code samples from MSDN, for retrieving messages from Exchange via web services. Even though I specify = many of the fields in each message (email addresses, b

login OWA of Exchange 2007 using .NET2003 Dear all, I've been using the code to write a .NET C# program to login OWA of 2003 and it works fine, however, when I port the program to work on Exchange

How do you enable impersonation in Exchange 2007? We are writing an app that needs to write to a users calendar. How do I enable I looked at the and the objects. I get an error message at runtime. I am not an Exchange Adminstrator but I can let t
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group