Contoso is our sample multi-forest Exchange organization. There is an Exchange forest and two user account forests. The Exchange forest is known as Contoso and it also contains user accounts. There are mailboxes for users in the Contoso forests and linked mailboxes for users in other forests. Contoso uses FIM to synch all its forests with a remote system.
Contoso would like the following requirements for the Metaverse (MV) Person Object
The MV Object deletion extension code will be triggered whenever a CS object is deleted or disconnected. Based on design above.
bool
IMVSynchronization.ShouldDeleteFromMV(CSEntry csentry, MVEntry mventry)
{
deleteNow =
false
;
IsMsExchMastPresent =
IsUPNValueContainContoso =
IsCSUPNContainContoso =
// Does the MVEntry have MsExchMasterAccountSid, if it doesn't then it is not a linked account
if
(mventry[
"MsExchMasterAccountSid"
].IsPresent)
true
}
Logging.Log(
"IsMsExchMastPresent is "
+ IsMsExchMastPresent,
, 2);
//Does the MVEntry UPN contain "@Contoso.com"
int
stringsearchMVforContoso = mventry[
"userPrincipalName"
].StringValue.IndexOf(
"@contoso.com"
);
(stringsearchMVforContoso > 0)
"IsUPNValueContainContoso is "
+ IsUPNValueContainContoso,
//Does the CSEntry UPN contain "@contoso.com"
//Logging.Log("csentry userPrincipalName is " + csentry["userPrincipalName"].StringValue, true, 2);
stringsearchCSforContoso = csentry[
(stringsearchCSforContoso > 0)
"IsCSUPNContainContoso is "
+ IsCSUPNContainContoso,
// Delete it if not from Contoso and it isn't linked
((IsMsExchMastPresent ==
) & (IsUPNValueContainContoso ==
))
//DO NOT Delete it if linked mailbox and the disconnected CS is from non-Contoso
else
) & (IsCSUPNContainContoso ==
//Delete it if linked mailbox and the disconnected CS is from Contoso
// Delete it if from Contoso and non-linked mailbox
//return value now.
return
deleteNow
TNJMAN edited Revision 10. Comment: Minor corrections
TNJMAN edited Revision 9. Comment: syntax and placement corrections
Nice article, but may benefit from code formatting
Looks like code is now formatted. Great article
Congrats on winning the gold medal in the August TechNet Guru contest! blogs.technet.com/.../technet-guru-awards-august-2013.aspx
We featured this article on the home page of TNWiki!
Nice indeed.
Excellent work. Maybe put in a "See Also" section, with references to a couple of related articles.
Very nice article! Thank you very much for sharing this knowledge.