Exemple #1
0
        protected override void WriteResult(IConfigurable dataObject)
        {
            TaskLogger.LogEnter();
            ADUser     aduser = (ADUser)dataObject;
            ADObjectId owaMailboxPolicy;

            if (aduser.OwaMailboxPolicy != null && OwaSegmentationSettings.UpdateOwaMailboxPolicy(aduser.OrganizationId, aduser.OwaMailboxPolicy, out owaMailboxPolicy))
            {
                aduser.OwaMailboxPolicy = owaMailboxPolicy;
            }
            if (this.RecalculateHasActiveSyncDevicePartnership == true)
            {
                IConfigurationSession configurationSession = this.GetConfigurationSession();
                MobileDevice[]        array = configurationSession.Find <MobileDevice>(aduser.ObjectId, QueryScope.SubTree, null, null, 0);
                bool flag = array.Length > 0;
                if (flag != aduser.HasActiveSyncDevicePartnership)
                {
                    aduser.HasActiveSyncDevicePartnership = flag;
                    IRecipientSession recipientSession = (IRecipientSession)this.CreateSession();
                    recipientSession.Save(aduser);
                }
            }
            base.WriteResult(aduser);
        }