public static void UpdateShadowWhenSoftDeletedProperty(IRecipientSession session, IConfigurationSession configSession, OrganizationId organizationId, ADUser user) { if (!session.ServerSettings.WriteShadowProperties || user.propertyBag[ADRecipientSchema.WhenSoftDeleted.ShadowProperty] != null) { return; } ExchangeConfigurationUnit exchangeConfigUnit = RecipientTaskHelper.GetExchangeConfigUnit(configSession, organizationId); if (exchangeConfigUnit != null && exchangeConfigUnit.MSOSyncEnabled) { user.propertyBag.SetField(ADRecipientSchema.WhenSoftDeleted.ShadowProperty, user.WhenSoftDeleted); session.Save(user); } }
public static bool MSODirSyncEnabled(IConfigurationSession session, OrganizationId organizationId) { ExchangeConfigurationUnit exchangeConfigUnit = RecipientTaskHelper.GetExchangeConfigUnit(session, organizationId); return(exchangeConfigUnit != null && exchangeConfigUnit.MSOSyncEnabled && exchangeConfigUnit.IsDirSyncRunning); }