public static string GetRecipientType(ConnectorObject cobject)
{
long? recipientTypeDetails =
ExchangeUtility.GetAttValue(ExchangeConnectorAttributes.AttMsExchRecipientTypeDetailsADName, cobject.GetAttributes()) as long?;
switch (recipientTypeDetails) { // see http://blogs.technet.com/b/benw/archive/2007/04/05/exchange-2007-and-recipient-type-details.aspx
case 1: return ExchangeConnectorAttributes.RcptTypeMailBox;
case 128: return ExchangeConnectorAttributes.RcptTypeMailUser;
case null: // we are dealing with user accounts, so we can assume that an account without Exchange information is an ordinary User
case 65536: return ExchangeConnectorAttributes.RcptTypeUser;
default:
LOGGER.TraceEvent(TraceEventType.Information, CAT_DEFAULT, "Unknown recipientTypeDetails: {0} ({1})", recipientTypeDetails,
ExchangeUtility.GetAttValue(ExchangeConnectorAttributes.AttMsExchRecipientTypeDetailsADName, cobject.GetAttributes()));
return null;
}
}