- Local freebusy object in the mailbox
- Permissions on folders that are given access to
- Rules collection if forward meeting requests option selected
What happens to the LocalFreeBusy object is of the most interest and has been documented in the http://msdn.microsoft.com/en-us/library/cc425488%28v=exchg.80%29.aspx protocol document basically it comes down to the following 7 Mapi properties on the LocalFreeBusy object.
These last three properties contain specific setting for each delegate user including the X500DN of the delegated users within PidTagScheduleInfoDelegateEntryIds (Its stored as Addessbook entryid).
If your observant you would have only counted 5 properties which is all that are documented in the protocol document. If you look at the object with a Mapi editor however you would discover two more undocumented properties that also hold information about delegates.
x6870 and x6871
To get the localfreebusy object in a mailbox using EWS there are a few methods you can use the first is to search the NON_IPM_Subtree for and find the FreeBusy Data folder and then search that folder for an item with a subject of localfreebusy. The other option is to use is the PR_FREEBUSY_ENTRYIDS extended property on the Non_IPM_Subtree which contains an array of FreeBusy EntryID's which the 2nd element is the LocalFreeBusy Object which you can convert into a EWSid using a convertid operation and then bind directly to that item.
So if your using EWS and you get "The delegate does not map to a user in the Active Directory" and you want to find out which user this refers to you can compare whats returned in PidTagScheduleInfoDelegateNamesW with the valid delegates you back with normal operation you should be able to work out the invalid delegate.
To demonstrate this I've put some Powershell cmdlet's together so basically you can display firstly the Raw property values, show what is invalid doing the compare i talked about above and then lastly you can do a unsupported remove which basically will remove the invalid entries out of the extended properties. The reason i said this is unsupported because its not really tested and its also only modifies the raw properties so all the other things like mailbox permission, forward rules will still be in-place (although I've also created some cmdlets to clean up invalid forward rules as well that I'll talk about in a separate post).
Get-MessageOps.MailboxDelegatesRaw : This Cmdlet retrieves the delegates from a mailbox by reading the Raw Mapi properties from the Local Freebusy Item in a mailbox.
eg Get-MessageOps.MailboxDelegates –p $ewsprofile –identity firstname.lastname@example.org
Get-MessageOps.MailboxDelegatesInvalid : This Cmdlet retrieves the delegates from a mailbox by reading the Raw Mapi properties from the Local Freebusy Item in a mailbox and then compares them against what is retrieved using a normal getdelegate operation.
eg. Get-MessageOps.MailboxDelegatesInvalid –p $ewsprofile –identity email@example.com
Remove-MessageOps.MailboxDelegatesInvalid.Unsupported : This Cmdlet retrieves the delegates from a mailbox by reading the Raw Mapi properties from the Local Freebusy Item in a mailbox and then compares them against what is retrieved using a normal getdelegate operation. It then modifies the Raw Mapi properties on the local freebusy object and removes any entries that it finds are invalid. Note this doesn’t remove the delegate forwarding rules if it exists and also doesn’t remove any delegate permissions if they have been set.
eg. Remove-MessageOps.MailboxDelegatesInvalid.Unsupported –p $ewsprofile –identity firstname.lastname@example.org
To use these cmdlets you need to download the following module http://www.messageops.com/downloads/MessageOps-Exchange-Module.zip