Note: This post is purely intended to demonstrate the use of MFCMAPI to delete calendar delegate rules. There are several other steps you may want to go through before you actually go ahead and follow steps in this post.
Outlook, LDAP and MAPI offer a great feature of delegation of mailboxes to a particular user within the organization. It works almost the same way in all version of Exchange Server 200x family. I am not pretty sure about Exchange 2010 yet because never had a chance to look at it so closely.
Well, though the delegation feature is a great facility provided to end users it becomes a pain for administrators sometimes. One of the most annoying situations I always come across is when someone reports that he/she sent an email to some distribution list and then got an NDR that indicates that the email was not delivered to a user which has been deleted recently and does not work for the company anymore. and the NDR looks like:
From: System Administrator
Sent: Tuesday, April 28, 2009 10:06 AM
To: Geek, Exchange
Subject: Test Meeting Request
Your message did not reach some or all of the intended recipients.
Subject: Test Meeting Request
Sent: 4/28/2009 10:06 AM
The following recipient(s) could not be reached:
Geek, Exchange on 4/28/2009 10:06 AM
The e-mail address could not be found. Perhaps the recipient moved to a different e-mail organization, or there was a mistake in the address. Check the address and try again.
<FQDN of my server.com #5.1.7>
This type of NDR starts generating after you delete some user account from your organization and this user account was also a part of some DL and at the same time was delegated permissions on some other user’s mailbox in the same DL. Another case would be when you already know the delegated mailbox name however you are not able to fix the issue.
1. When you don’t know the name of the delegated mailbox yet you get the NDR:
Download the script at Glenn’s blog and run it in your Exchange Organization to find the user who had the deleted user account set as delegate or have a rule configured to forward emails. This script can be downloaded from http://gsexdev.blogspot.com/2006/08/reporting-on-meeting-delegate-forward.html (This script requires you having full mailbox access on all mailboxes in your organization)
Script shows all the delegate and forwarding rules in mailboxes. I will strongly recommend reading instructions at above link before you run it.
Once you get the name of desired mailbox you can certainly remove the rule either by logging on to the mailbox or by using MFCMAPI or mdbview32.exe. An alternate location to download it would be here.
2. When you know the delegated user account name but can not remove the rule using outlook:
Now, here you can use MFCMAPI to remove all those calendaring delegates and forward rules from a particular mailbox. Steps are below:
A. Open MFCMAPI.exe and logon to the store with Administrator privileges or with an user account which has full access to other mailboxes. To logon follow Session –> Logon and Display Store Table. This will show up the screen like below;
B. Right click on the mailbox you are logged on as and select Open Store from the context menu.
C. The next screen comes up which explore all visible and invisible folders in your mailbox.
D. Expand Root Container at the top of tree structure –> Expand Top of Information Store –> right click on Inbox and select Display Rules Table
E. Another windows opens up and shows you the rules configured in the mailbox. Please note that only server side rules are displayed here.
F. This window may display several other rules as well. You have to find and select the rule which is provided by Schedule+ EMS Interface.
G. Right click on the rule and select to delete.
F. Any other rule can also be deleted using the similar method.