I need to distribute a rule to all my users. Conditions are subject contains, from and has attachment. I didn't want to reinvent the wheel for this, so I initially tried New-InboxRule from the Exchange 2010 Management Shell. I was able to create the rule, but any rules that were disabled from Outlook were deleted in the process. This behavior appears to be by design.
Next I tried using Exchange Web Services managed API, again I was able to create the rule, but anything that had been disabled in Outlook wasn't visible and was deleted as soon as I saved the new rule.
The I wrote some code to do this using Redemption Data Objects, and discovered it had the same disadvantage.
Just to clarify I have no problem creating the rule using any of these methods. It's the deletion of rules that were previously disabled in Outlook that's a show stopper.
I don't want to waste my time rewriting with CDO as I generally consider RDO to be more robust, I doubt it would work. I don't think Outlook Object Model has the ability to logon to another mailbox, and so too hard to run as a server side job.
I know about rule.dll from the Exchange 5.5 SDK, but due to it's age we'd really like to move away from that. Ideally ESM commands or EWS code is preferred. I'm happy to use Redemption, but it has the same limitation.
Unfortunately MAPI/Extended MAPI programing is beyond my skill set. Is there any way to manage rules that were disabled from Outlook, using any of these interfaces?
Let me know what you think, it would be appreciated.