private VariantConfigurationSnapshot GetDiagnosticInfoSnapshot(SettingOverrideSync.SettingOverrideDiagnosableArgument argument, out string error) { IConstraintProvider constraintProvider = MachineSettingsContext.Local; if (argument.HasArgument("user")) { string userId = argument.GetArgument <string>("user"); if (!string.IsNullOrWhiteSpace(userId)) { string orgId = null; if (argument.HasArgument("org")) { orgId = argument.GetArgument <string>("org"); } if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled&& string.IsNullOrEmpty(orgId)) { error = "Org is required."; return(null); } ADUser user = null; ADNotificationAdapter.TryRunADOperation(delegate() { user = new SettingOverrideSync.UserResolver(userId, orgId).Resolve(); }, 3); if (user == null) { error = "User not found."; return(null); } constraintProvider = user.GetContext(null); } } error = null; return(VariantConfiguration.GetSnapshot(constraintProvider, null, null)); }
internal static int CalculateMemberRights(IEnumerable <MailboxFolderAccessRight> accessRights, bool isCalendarFolder) { int num = 0; if (accessRights != null) { bool flag = isCalendarFolder && VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.IncludeFBOnlyForCalendarContributor.Enabled; foreach (MailboxFolderAccessRight accessRight in accessRights) { if (isCalendarFolder && accessRight.IsRole && (int)accessRight != 2048 && (int)accessRight != 6144) { if (flag && (int)accessRight == 1026) { num |= ((int)accessRight | 2048); } else { num |= ((int)accessRight | 6144); } } else { num |= (int)accessRight; } } } return(num); }
private SettingOverride[] Load(SettingOverride[] existingValue) { try { IEnumerable <SettingOverrideSync.SettingOverrideDiagnosticInfo> source = this.ReadOverrides(); VariantConfigurationOverride[] overrides = (from o in source where o.Status == SettingOverrideSync.OverrideStatus.Accepted select o.Override.GetVariantConfigurationOverride()).ToArray <VariantConfigurationOverride>(); this.overridesInfo = source; if (VariantConfiguration.SetOverrides(overrides)) { if (this.cache.RefreshInterval != this.RefreshInterval) { this.cache.SetRefreshInterval(this.RefreshInterval); } } else { EventHandler <RefreshCompletedEventArgs> refreshCompleted = this.RefreshCompleted; if (refreshCompleted != null) { refreshCompleted(this, new RefreshCompletedEventArgs(false, VariantConfiguration.Overrides)); } } this.HandleLoadSuccess(overrides); } catch (ConfigurationSettingsADConfigDriverException e) { this.HandleLoadException(e); throw; } return(null); }
internal static bool UpdateAuthenticationModules(ServerManager serverManager, string siteName, string virtualPath, MultiValuedProperty <AuthenticationMethod> authMethods, bool useApplicationHostConfigForModules) { bool flag = false; string text = siteName + virtualPath; ConfigurationSection section; if (useApplicationHostConfigForModules) { Configuration configuration = serverManager.GetApplicationHostConfiguration(); section = configuration.GetSection("system.webServer/modules", text); } else { Configuration configuration = serverManager.Sites[siteName].Applications[virtualPath].GetWebConfiguration(); section = configuration.GetSection("system.webServer/modules"); } if (section == null) { throw new WebObjectNotFoundException(Strings.ExceptionWebObjectNotFound(siteName + "/" + virtualPath + "/system.webServer/modules")); } ConfigurationElementCollection collection = section.GetCollection(); if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.WindowsLiveID.Enabled) { flag |= IISConfigurationUtilities.UpdateWebServerModule(collection, "LiveIdBasicAuthModule", "Microsoft.Exchange.Security.Authentication.LiveIdBasicAuthModule, Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35", authMethods.Contains(AuthenticationMethod.LiveIdBasic)); flag |= IISConfigurationUtilities.UpdateWebServerModule(collection, "LiveIdNegotiateAuxiliaryModule", "Microsoft.Exchange.Security.Authentication.LiveIdNegotiateAuxiliaryModule, Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35", authMethods.Contains(AuthenticationMethod.LiveIdNegotiate)); } return(flag | IISConfigurationUtilities.UpdateWebServerModule(collection, "OAuthAuthModule", typeof(OAuthHttpModule).AssemblyQualifiedName, authMethods.Contains(AuthenticationMethod.OAuth))); }
// Token: 0x06000040 RID: 64 RVA: 0x00002F4C File Offset: 0x0000114C private RULE_PACKAGE_DETAILS LoadRules(string packageId) { ULS.SendTraceTag(4850015U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 50, "FASTClassificationStore.GetDefaultRulePackageDetails :: Loading rules for package [{0}]", new object[] { packageId }); RULE_PACKAGE_DETAILS result = default(RULE_PACKAGE_DETAILS); result.RulePackageID = packageId; result.RulePackageSetID = "NA"; List <string> list = new List <string>(); if (this.defaultRuleSet.PackageId == packageId) { foreach (string text in this.defaultRuleSet.AllRuleIds) { if (VariantConfiguration.IsFeatureEnabled(40, text)) { ULS.SendTraceTag(4850016U, ULSCat.msoulscat_SEARCH_DataLossPrevention, 100, "FASTClassificationStore.GetDefaultRulePackageDetails :: Adding rule [{0}]", new object[] { text }); list.Add(text); } } } result.RuleIDs = list.ToArray(); return(result); }
private static FreeBusyPermissionLevel FromInternalClient(InternalClientContext internalClientContext, RawSecurityDescriptor securityDescriptor, FreeBusyQuery freeBusyQuery) { if (internalClientContext.ClientSecurityContext == null) { FreeBusyPermission.SecurityTracer.TraceDebug <object, EmailAddress>(0L, "{0}: Caller {1} has no ClientSecurityContext, using default context as 'everyone'.", TraceContext.Get(), freeBusyQuery.Email); return(FreeBusyPermission.AccessCheck(securityDescriptor, ClientSecurityContext.FreeBusyPermissionDefaultClientSecurityContext)); } if (!Configuration.UseDisabledAccount || VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled) { return(FreeBusyPermission.GetPermissionLevel(internalClientContext.ClientSecurityContext, freeBusyQuery, securityDescriptor)); } FreeBusyPermission.SecurityTracer.TraceDebug <object, InternalClientContext>(0L, "{0}: Creating a munged security context for caller {1}.", TraceContext.Get(), internalClientContext); ClientSecurityContext clientSecurityContext = null; try { clientSecurityContext = new SlaveAccountTokenMunger().MungeToken(internalClientContext.ClientSecurityContext, OrganizationId.ForestWideOrgId); return(FreeBusyPermission.GetPermissionLevel(clientSecurityContext, freeBusyQuery, securityDescriptor)); } catch (TokenMungingException arg) { FreeBusyPermission.SecurityTracer.TraceError <object, InternalClientContext, TokenMungingException>(0L, "{0}: Unable to get the munged token for Caller {1}, error {2}, using the client context supplied.", TraceContext.Get(), internalClientContext, arg); } finally { if (clientSecurityContext != null) { clientSecurityContext.Dispose(); } } return(FreeBusyPermission.GetPermissionLevel(internalClientContext.ClientSecurityContext, freeBusyQuery, securityDescriptor)); }
// Token: 0x060005DE RID: 1502 RVA: 0x0002C928 File Offset: 0x0002AB28 private void ResolveDeletionInfo() { if (this.deletionInfo != null) { return; } this.deletionInfo = new DumpsterExpirationEnforcer.ExpirationInfoPair { IsEnabled = false, AgeLimit = EnhancedTimeSpan.MaxValue }; if (base.MailboxDataForTags.AbsoluteLitigationHoldEnabled) { DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer>((long)this.GetHashCode(), "{0}: This user is under litigation hold. This user's dumpster will be skipped.", this); this.deletionInfo.IsEnabled = false; } else { DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer>((long)this.GetHashCode(), "{0}: This user is not under litigation hold. His dumpster will be processed.", this); this.deletionInfo.IsEnabled = true; } if (base.MailboxDataForTags.ElcUserTagInformation.ADUser.UseDatabaseRetentionDefaults) { DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, EnhancedTimeSpan?>((long)this.GetHashCode(), "{0}: UseDatabaseRetentionDefaults is true. The DB retention period of {1} will be used.", this, base.SysCleanupSubAssistant.DatabaseConfig.DumpsterRetentionPeriod); this.deletionInfo.AgeLimit = (base.SysCleanupSubAssistant.DatabaseConfig.DumpsterRetentionPeriod ?? EnhancedTimeSpan.MaxValue); if (base.SysCleanupSubAssistant.DatabaseConfig.RetainDeletedItemsUntilBackup) { EnhancedTimeSpan enhancedTimeSpan = base.MailboxDataForTags.UtcNow - base.SysCleanupSubAssistant.DatabaseConfig.LastFullBackup; if (this.deletionInfo.AgeLimit < enhancedTimeSpan) { this.deletionInfo.AgeLimit = enhancedTimeSpan; } DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, EnhancedTimeSpan, EnhancedTimeSpan>((long)this.GetHashCode(), "{0}: DatabaseConfig.RetainDeletedItemsUntilBackup is true. ageLimitFromBackup={1}, nullableAgeLimitForRegularItems is {2}.", this, enhancedTimeSpan, this.deletionInfo.AgeLimit); } } else { DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, EnhancedTimeSpan>((long)this.GetHashCode(), "{0}: UseDatabaseRetentionDefaults is false. The mailbox retention period of {1} will be used.", this, base.MailboxDataForTags.ElcUserTagInformation.ADUser.RetainDeletedItemsFor); this.deletionInfo.AgeLimit = base.MailboxDataForTags.ElcUserTagInformation.ADUser.RetainDeletedItemsFor; if (base.MailboxDataForTags.ElcUserTagInformation.ADUser.RetainDeletedItemsUntilBackup) { EnhancedTimeSpan enhancedTimeSpan2 = base.MailboxDataForTags.UtcNow - base.SysCleanupSubAssistant.DatabaseConfig.LastFullBackup; if (this.deletionInfo.AgeLimit < enhancedTimeSpan2) { this.deletionInfo.AgeLimit = enhancedTimeSpan2; } DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, EnhancedTimeSpan, EnhancedTimeSpan>((long)this.GetHashCode(), "{0}: Mailbox.RetainDeletedItemsUntilBackup is true. ageLimitFromBackup={1}, nullableAgeLimitForRegularItems is {2}.", this, enhancedTimeSpan2, this.deletionInfo.AgeLimit); } } if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled) { TimeSpan config = ElcGlobals.Configuration.GetConfig <TimeSpan>("SingleItemRecoveryRetention"); if (!config.Equals(TimeSpan.Zero)) { DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, TimeSpan>((long)this.GetHashCode(), "{0}: ElcConfigSchema.Setting.SingleItemRecoveryRetention is {1}. Set the mailbox retention period to that value.", this, config); this.deletionInfo.AgeLimit = config; } } base.MailboxDataForTags.StatisticsLogEntry.DeletionAgeLimit = this.deletionInfo.AgeLimit.ToString(); }
protected override void InternalProcessMetabase() { ADOwaVirtualDirectory adowaVirtualDirectory = WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADOwaVirtualDirectory>(this.DataObject, base.DataSession); if (adowaVirtualDirectory != null && !string.IsNullOrEmpty(adowaVirtualDirectory.DefaultDomain)) { this.DataObject.DefaultDomain = adowaVirtualDirectory.DefaultDomain; } WebAppVirtualDirectoryHelper.UpdateMetabase(this.DataObject, this.DataObject.MetabasePath, true); if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ReportingWebService.Enabled) { string physicalPath; List <MetabaseProperty> metabaseProperties; if (base.Role == VirtualDirectoryRole.ClientAccess) { physicalPath = System.IO.Path.Combine(ConfigurationContext.Setup.InstallPath, "FrontEnd\\HttpProxy\\ReportingWebService"); metabaseProperties = this.CreateFrontEndVdirProperies(); } else { physicalPath = System.IO.Path.Combine(ConfigurationContext.Setup.InstallPath, "ClientAccess\\ReportingWebService"); metabaseProperties = this.CreateBackEndVdirProperies(); } this.CreateReportingWebServiceVDir(this.DataObject.MetabasePath, physicalPath, metabaseProperties); if (base.Role == VirtualDirectoryRole.ClientAccess) { string parent = string.Format(CultureInfo.InvariantCulture, "{0}/{1}", new object[] { this.DataObject.MetabasePath, "ReportingWebService" }); this.CreatePartnerVDir(parent); } } }
private void DisallowPublicFolderMoveDuringFinalization() { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Mrs.PublicFolderMailboxesMigration.Enabled&& CommonUtils.IsPublicFolderMailboxesLockedForNewConnectionsFlagSet(base.CurrentOrganizationId)) { base.WriteError(new RecipientTaskException(new LocalizedString(ServerStrings.PublicFoldersCannotBeMovedDuringMigration)), ErrorCategory.InvalidOperation, this.targetMailboxUser); } }
protected override void PrepareUserObject(ADUser user) { TaskLogger.LogEnter(); if (base.WindowsLiveID == null && base.SoftDeletedObject == null && VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.WindowsLiveID.Enabled&& !RecipientTaskHelper.SMTPAddressCheckWithAcceptedDomain(this.ConfigurationSession, user.OrganizationId, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache)) { base.WriteError(new RecipientTaskException(Strings.ErrorWindowsLiveIdRequired(user.Name)), ExchangeErrorCategory.Client, null); } if (base.WindowsLiveID != null && base.WindowsLiveID.SmtpAddress != SmtpAddress.Empty) { if (this.ExternalEmailAddress == null) { user.ExternalEmailAddress = ProxyAddress.Parse(base.WindowsLiveID.SmtpAddress.ToString()); } user.UserPrincipalName = base.WindowsLiveID.SmtpAddress.ToString(); base.IsSetRandomPassword = (base.SoftDeletedObject == null || base.IsSetRandomPassword); } if (string.IsNullOrEmpty(user.UserPrincipalName)) { user.UserPrincipalName = RecipientTaskHelper.GenerateUniqueUserPrincipalName(base.TenantGlobalCatalogSession, user.Name, this.ConfigurationSession.GetDefaultAcceptedDomain().DomainName.Domain, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose)); } if (base.SoftDeletedObject == null) { if (base.Fields.IsModified(MailUserSchema.RemotePowerShellEnabled)) { user.RemotePowerShellEnabled = this.RemotePowerShellEnabled; } else { user.RemotePowerShellEnabled = true; } MailUserTaskHelper.ValidateExternalEmailAddress(user, this.ConfigurationSession, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache); } if (base.Fields.IsChanged(ADRecipientSchema.MailboxProvisioningConstraint)) { user.MailboxProvisioningConstraint = this.MailboxProvisioningConstraint; } if (base.Fields.IsChanged(ADRecipientSchema.MailboxProvisioningPreferences)) { user.MailboxProvisioningPreferences = this.MailboxProvisioningPreferences; } if (user.MailboxProvisioningConstraint != null) { MailboxTaskHelper.ValidateMailboxProvisioningConstraintEntries(new MailboxProvisioningConstraint[] { user.MailboxProvisioningConstraint }, base.DomainController, delegate(string message) { base.WriteVerbose(new LocalizedString(message)); }, new Task.ErrorLoggerDelegate(base.WriteError)); } if (user.MailboxProvisioningPreferences != null) { MailboxTaskHelper.ValidateMailboxProvisioningConstraintEntries(user.MailboxProvisioningPreferences, base.DomainController, delegate(string message) { base.WriteVerbose(new LocalizedString(message)); }, new Task.ErrorLoggerDelegate(base.WriteError)); } base.PrepareUserObject(user); TaskLogger.LogExit(); }
private bool TryGetMailboxIdFromIdentity(string identity, out MailboxIdParameter mailboxId) { mailboxId = null; if (string.IsNullOrEmpty(identity)) { return(false); } int num = identity.IndexOf('/'); if (num <= 0) { return(false); } int num2 = identity.IndexOf("ExchangeActiveSyncDevices"); if (num2 <= 0) { return(false); } string text = identity.Substring(0, num2 - 1); if (!VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled) { text = text.Substring(text.LastIndexOf('/') + 1); } mailboxId = new MailboxIdParameter(text); return(true); }
protected override void InternalValidate() { if (base.OptionalIdentityData != null) { base.OptionalIdentityData.ConfigurationContainerRdn = ClassificationDefinitionConstants.ClassificationDefinitionsRdn; } base.InternalValidate(); if (base.HasErrors) { return; } ExAssert.RetailAssert(base.DataObject != null, "DataObject must not be null at this point as it should have been resolved by the base class."); if (!ClassificationDefinitionUtils.IsAdObjectAClassificationRuleCollection(base.DataObject)) { base.WriteError(new ClassificationRuleCollectionInvalidObjectException(Strings.ClassificationRuleCollectionInvalidObject), ErrorCategory.InvalidOperation, null); } if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled&& OrganizationId.ForestWideOrgId.Equals(((IDirectorySession)base.DataSession).SessionSettings.CurrentOrganizationId) && !this.Identity.IsHierarchical) { base.WriteError(new ClassificationRuleCollectionIllegalScopeException(Strings.ClassificationRuleCollectionIllegalScopedRemoveOperation), ErrorCategory.InvalidOperation, null); } SortedSet <string> sortedSet = new SortedSet <string>(); IList <string> allRulesInUse = this.GetAllRulesInUse(base.DataObject, sortedSet); if (allRulesInUse.Count > 0) { LocalizedString message = Strings.ClassificationRuleCollectionSharingViolationRemoveOperationVerbose(this.Identity.ToString(), string.Join(Strings.ClassificationRuleCollectionOffendingListSeparator, allRulesInUse), string.Join(Strings.ClassificationRuleCollectionOffendingListSeparator, sortedSet)); ClassificationRuleCollectionSharingViolationException exception = ClassificationDefinitionUtils.PopulateExceptionSource <ClassificationRuleCollectionSharingViolationException, IList <string> >(new ClassificationRuleCollectionSharingViolationException(message), allRulesInUse); base.WriteError(exception, ErrorCategory.InvalidOperation, null); } }
private static string GetLogoffURL(RequestContext requestContext) { if (VariantConfiguration.InvariantNoFlightingSnapshot.OwaServer.OwaClientAccessRulesEnabled.Enabled && "5".Equals(requestContext.HttpContext.Request.Params["reason"])) { return(OwaUrl.LogonFBAOWABlockedByClientAccessRules.GetExplicitUrl(requestContext.HttpContext.Request)); } if (VariantConfiguration.InvariantNoFlightingSnapshot.Eac.EACClientAccessRulesEnabled.Enabled && "6".Equals(requestContext.HttpContext.Request.Params["reason"])) { Uri requestUrlEvenIfProxied = requestContext.HttpContext.Request.GetRequestUrlEvenIfProxied(); string str = string.Format("{0}://{1}{2}/ecp/", requestUrlEvenIfProxied.Scheme, requestUrlEvenIfProxied.Host, requestUrlEvenIfProxied.IsDefaultPort ? string.Empty : string.Format(":{0}", requestUrlEvenIfProxied.Port)); return(string.Format(OwaUrl.LogonFBAEACBlockedByClientAccessRules.GetExplicitUrl(requestContext.HttpContext.Request), HttpUtility.UrlEncode(str))); } if (LogOnSettings.IsLegacyLogOff) { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.RedirectToLogoffPage.Enabled) { return(OwaUrl.LogoffAspxPage.GetExplicitUrl(requestContext.HttpContext.Request)); } return(OwaUrl.LogonFBA.GetExplicitUrl(requestContext.HttpContext.Request)); } else { bool enabled = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled; if (enabled) { Uri requestUrlEvenIfProxied2 = requestContext.HttpContext.Request.GetRequestUrlEvenIfProxied(); Uri uri = new Uri(requestUrlEvenIfProxied2, OwaUrl.LogoffAspxPage.GetExplicitUrl(requestContext.HttpContext.Request)); string explicitUrl = OwaUrl.SignOutPage.GetExplicitUrl(requestContext.HttpContext.Request); Uri uri2 = new Uri(requestUrlEvenIfProxied2, explicitUrl); return(uri.ToString() + "&ru=" + uri2.ToString()); } return(OwaUrl.SignOutPage.GetExplicitUrl(requestContext.HttpContext.Request)); } }
public SyncStateMetadata GetMetadataFromPropertyBag(IStorePropertyBag propertyBag, string displayName, ISyncLogger syncLogger = null) { byte[] byteArray = null; if (!DeviceSyncStateMetadata.TryGetPropertyFromBag <byte[]>(propertyBag, InternalSchema.SyncFolderSourceKey, out byteArray, syncLogger)) { syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Creating custom sync state metadata for folder '{0}'", displayName); return(new SyncStateMetadata(this, displayName, null, null)); } StoreObjectId storeObjectId = StoreObjectId.Deserialize(byteArray); syncLogger.TraceDebug <string, StoreObjectId>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Found SyncFolderSourceKey for {0}, so it is a FolderSyncState: {1}", displayName, storeObjectId); long localCommitTimeMax = 0L; int deletedCountTotal = 0; int syncKey = 0; int airSyncFilter = 0; bool conversationMode = false; int airSyncSettingsHash = 0; int airSyncMaxItems = 0; VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null); bool flag = snapshot != null && snapshot.DataStorage.IgnoreInessentialMetaDataLoadErrors != null && snapshot.DataStorage.IgnoreInessentialMetaDataLoadErrors.Enabled; syncLogger.TraceDebug <bool>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] ignoreInessentialMetaDataLoadErrors: {0}", flag); long airSyncLastSyncTime; bool flag2 = DeviceSyncStateMetadata.TryGetPropertyFromBag <long>(propertyBag, AirSyncStateSchema.MetadataLastSyncTime, out airSyncLastSyncTime, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <long>(propertyBag, AirSyncStateSchema.MetadataLocalCommitTimeMax, out localCommitTimeMax, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataDeletedCountTotal, out deletedCountTotal, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataSyncKey, out syncKey, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataFilter, out airSyncFilter, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <bool>(propertyBag, AirSyncStateSchema.MetadataConversationMode, out conversationMode, syncLogger) && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataSettingsHash, out airSyncSettingsHash, syncLogger); bool flag3 = flag2 && DeviceSyncStateMetadata.TryGetPropertyFromBag <int>(propertyBag, AirSyncStateSchema.MetadataMaxItems, out airSyncMaxItems, syncLogger); flag2 = (flag ? flag2 : flag3); if (flag2) { syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Creating FolderSync metadata for folder '{0}'", displayName); return(new FolderSyncStateMetadata(this, displayName, null, null, localCommitTimeMax, deletedCountTotal, syncKey, conversationMode, airSyncFilter, airSyncLastSyncTime, airSyncSettingsHash, airSyncMaxItems, storeObjectId)); } syncLogger.TraceDebug <string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetMetadataFromPropertyBag] Failed to get nullSync properties for sync folder '{0}'.", displayName); return(new FolderSyncStateMetadata(this, displayName, null, null, 0L, 0, 0, false, 0, 0L, 0, 0, storeObjectId)); }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); if (this.FederatedIdentity != null && this.Password != null) { base.WriteError(new RecipientTaskException(Strings.ErrorFederatedIdentityandPasswordTogether), ExchangeErrorCategory.Client, this.DataObject.Identity); } if (this.DataObject.IsChanged(MailUserSchema.WindowsLiveID)) { MailboxTaskHelper.IsMemberExists((IRecipientSession)base.DataSession, this.DataObject.WindowsLiveID, new Task.ErrorLoggerDelegate(base.WriteError)); } if (this.DataObject.IsModified(MailUserSchema.UserPrincipalName)) { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ValidateExternalEmailAddressInAcceptedDomain.Enabled&& this.ShouldCheckAcceptedDomains()) { RecipientTaskHelper.ValidateInAcceptedDomain(this.ConfigurationSession, this.DataObject.OrganizationId, RecipientTaskHelper.GetDomainPartOfUserPrincalName(this.DataObject.UserPrincipalName), new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache); } RecipientTaskHelper.IsUserPrincipalNameUnique(base.TenantGlobalCatalogSession, this.DataObject, this.DataObject.UserPrincipalName, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } if (this.DataObject.IsChanged(MailboxSchema.JournalArchiveAddress) && this.DataObject.JournalArchiveAddress != SmtpAddress.NullReversePath && this.DataObject.JournalArchiveAddress != SmtpAddress.Empty) { RecipientTaskHelper.IsJournalArchiveAddressUnique(base.TenantGlobalCatalogSession, this.DataObject.OrganizationId, this.DataObject, this.DataObject.JournalArchiveAddress, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } if (this.DataObject.IsModified(MailUserSchema.SamAccountName)) { RecipientTaskHelper.IsSamAccountNameUnique(this.DataObject, this.DataObject.SamAccountName, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } TaskLogger.LogExit(); }
public static TargetForestConfiguration FindByDomain(OrganizationId organizationId, string domainName) { if (!VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled) { TargetForestConfiguration result; if (!TargetForestConfigurationCache.cache.TryGetValue(domainName, out result)) { TargetForestConfigurationCache.ConfigurationTracer.TraceError <object, string>(0L, "{0}: TargetForestConfiguration for domain {1} could not be found in cache", TraceContext.Get(), domainName); throw new AddressSpaceNotFoundException(Strings.descConfigurationInformationNotFound(domainName), 51004U); } return(result); } else { if (organizationId == null) { OrganizationId forestWideOrgId = OrganizationId.ForestWideOrgId; } OrganizationIdCacheValue organizationIdCacheValue = OrganizationIdCache.Singleton.Get(organizationId); if (organizationIdCacheValue == null) { TargetForestConfigurationCache.ConfigurationTracer.TraceError <object, OrganizationId>(0L, "{0}: Unable to find organization {1} in the OrgId cache", TraceContext.Get(), organizationId); throw new AddressSpaceNotFoundException(Strings.descConfigurationInformationNotFound(domainName), 64316U); } AvailabilityAddressSpace availabilityAddressSpace = organizationIdCacheValue.GetAvailabilityAddressSpace(domainName); if (availabilityAddressSpace != null) { TargetForestConfiguration result = TargetForestConfigurationCache.ConstructTargetForestConfiguration(availabilityAddressSpace, null); return(result); } TargetForestConfigurationCache.ConfigurationTracer.TraceError <object, string, OrganizationId>(0L, "{0}: TargetForestConfiguration for domain {1} could not be found in cache for organization {2}", TraceContext.Get(), domainName, organizationId); throw new AddressSpaceNotFoundException(Strings.descConfigurationInformationNotFound(domainName), 47932U); } }
// Token: 0x060075F5 RID: 30197 RVA: 0x0018411C File Offset: 0x0018231C public virtual ResourceLoad GetResourceLoad(WorkloadType type, bool raw = false, object optionalData = null) { VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null); IWorkloadSettings @object = snapshot.WorkloadManagement.GetObject <IWorkloadSettings>(type, new object[0]); return(this.GetResourceLoad(@object.Classification, raw, optionalData)); }
private static bool IsACLableSyncedObjectEnabled(ADUser source, MailboxMoveHelper.Scenario scenario) { bool result = false; Trace exceptionTracer = ExTraceGlobals.ExceptionTracer; if (!MailboxMoveHelper.IsCrossPremiseScenario(scenario)) { result = true; } else if (!VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled) { try { IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(source.OrganizationId), 605, "IsACLableSyncedObjectEnabled", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Common\\recipient\\MailboxMoveHelper.cs"); ADObjectId orgContainerId = tenantOrTopologyConfigurationSession.GetOrgContainerId(); ADOrganizationConfig adorganizationConfig = tenantOrTopologyConfigurationSession.Read <ADOrganizationConfig>(orgContainerId); if (adorganizationConfig != null) { result = adorganizationConfig.ACLableSyncedObjectEnabled; } } catch (LocalizedException ex) { exceptionTracer.TraceWarning(100L, ex.Message); } catch (Exception ex2) { exceptionTracer.TraceWarning(200L, ex2.Message); } } return(result); }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); TDataObject dataObject = this.DataObject; if (dataObject.IsModified(ADRecipientSchema.Alias)) { TDataObject dataObject2 = this.DataObject; if (string.IsNullOrEmpty(dataObject2.Alias)) { LocalizedException exception = new RecipientTaskException(Strings.ErrorAliasEmpty); ExchangeErrorCategory category = ExchangeErrorCategory.Client; TDataObject dataObject3 = this.DataObject; base.WriteError(exception, category, dataObject3.Identity); } } TDataObject dataObject4 = this.DataObject; if (dataObject4.IsChanged(ADRecipientSchema.ModeratedBy)) { int num = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled ? 10 : 25; TDataObject dataObject5 = this.DataObject; if (dataObject5.ModeratedBy != null) { TDataObject dataObject6 = this.DataObject; if (dataObject6.ModeratedBy.Count > num) { base.WriteError(new RecipientTaskException(Strings.ErrorTooManyModerators(num)), ExchangeErrorCategory.Client, null); } } } TaskLogger.LogExit(); }
private void RenderChangePassword() { string s; try { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.IsLogonFormatEmail.Enabled) { s = Utilities.HtmlEncode(this.owaContext.LogonIdentity.PrimarySmtpAddress.ToString()); } else { s = Utilities.HtmlEncode(this.owaContext.LogonIdentity.GetLogonName()); } } catch (OwaIdentityException innerException) { throw new OwaChangePasswordTransientException(Strings.ChangePasswordFailedGetName, innerException); } base.RenderHeaderRow(ThemeFileId.ChangePassword, -392390655); this.writer.Write("<tr><td class=\"bd\">"); this.RenderHelpText(LocalizedStrings.GetHtmlEncoded(-295337682)); this.RenderHelpText(LocalizedStrings.GetHtmlEncoded(-255077324)); this.writer.Write("<div class=\"indnt1\">"); this.writer.Write("<table class=\"pwd\">"); this.RenderDomainUsername(Utilities.HtmlEncode(s)); this.RenderPasswordTextBox("txtOldPwd", LocalizedStrings.GetHtmlEncoded(328139404)); this.RenderPasswordTextBox("txtNewPwd", LocalizedStrings.GetHtmlEncoded(-1594174847)); this.RenderPasswordTextBox("txtConfirmPwd", LocalizedStrings.GetHtmlEncoded(1735206531)); this.writer.Write("</table>"); this.writer.Write("</div>"); this.writer.Write("</td></tr>"); }
public void Render(string helpFile) { this.writer.Write("<table cellpadding=0 cellspacing=0><tr><td class=\"w100\">"); this.RenderSearchModule(); this.writer.Write("</td><td>"); this.RenderButtonsStart(); if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.RenderPrivacyStatement.Enabled) { string text = Utilities.BuildPrivacyStatmentHref(this.userContext); if (!string.IsNullOrEmpty(text)) { this.RenderPrivacyStatementLink(text); this.RenderDivider(); } } this.RenderAddressBookButton(); this.RenderDivider(); this.RenderOptionsButton(); this.RenderDivider(); this.RenderHelpButton(helpFile, string.Empty); this.RenderDivider(); this.RenderLogOffButton(); this.RenderButtonsEnd(); this.writer.Write("</td></tr></table>"); }
public static void ValidateExternalEmailAddress(ADContact contact, IConfigurationSession configurationSession, Task.ErrorLoggerDelegate writeError, ProvisioningCache provisioningCache) { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ValidateExternalEmailAddressInAcceptedDomain.Enabled) { SmtpProxyAddress smtpProxyAddress = contact.ExternalEmailAddress as SmtpProxyAddress; if (smtpProxyAddress == null) { writeError(new RecipientTaskException(Strings.ErrorExternalEmailAddressNotSmtpAddress((contact.ExternalEmailAddress == null) ? "$null" : contact.ExternalEmailAddress.ToString())), ExchangeErrorCategory.Client, contact.Identity); return; } if (RecipientTaskHelper.SMTPAddressCheckWithAcceptedDomain(configurationSession, contact.OrganizationId, writeError, provisioningCache)) { string domain = new SmtpAddress(smtpProxyAddress.SmtpAddress).Domain; if (RecipientTaskHelper.IsAcceptedDomain(configurationSession, contact.OrganizationId, domain, provisioningCache)) { writeError(new RecipientTaskException(Strings.ErrorIsAcceptedDomain(domain)), ExchangeErrorCategory.Client, null); } } contact.EmailAddressPolicyEnabled = false; if (contact.PrimarySmtpAddress == SmtpAddress.Empty) { contact.PrimarySmtpAddress = new SmtpAddress(smtpProxyAddress.SmtpAddress); } } }
// Token: 0x06001C2A RID: 7210 RVA: 0x0006F4BC File Offset: 0x0006D6BC public ChainValidityStatus ValidateCertificate(X509Certificate2 certificate, bool isSend) { this.response.PolicyFlag = 0U; this.response.ChainData = null; ChainContext chainContext = null; ChainValidityStatus chainValidityStatus; try { X509KeyUsageFlags expectedUsage = X509KeyUsageFlags.NonRepudiation | X509KeyUsageFlags.DigitalSignature; bool checkCRLOnSend = this.smimeAdminOptions.CheckCRLOnSend; bool disableCRLCheck = this.smimeAdminOptions.DisableCRLCheck; uint crlconnectionTimeout = this.smimeAdminOptions.CRLConnectionTimeout; uint crlretrievalTimeout = this.smimeAdminOptions.CRLRetrievalTimeout; bool flag = disableCRLCheck || (isSend && !checkCRLOnSend); if (string.IsNullOrEmpty(this.smimeAdminOptions.SMIMECertificateIssuingCAFull)) { bool enabled = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled; if (enabled) { chainValidityStatus = (ChainValidityStatus)2148204809U; this.response.PolicyFlag = 65536U; } else { chainValidityStatus = X509CertificateCollection.ValidateCertificate(certificate, null, expectedUsage, !flag, null, null, TimeSpan.FromMilliseconds(crlconnectionTimeout), TimeSpan.FromMilliseconds(crlretrievalTimeout), ref chainContext, false, null); this.response.PolicyFlag = (uint)this.MapChainStatusToChainFlag(chainValidityStatus); } } else { X509Store x509Store = CertificateStore.Open(StoreType.Memory, null, OpenFlags.ReadWrite); X509Certificate2Collection x509Certificate2Collection = new X509Certificate2Collection(); x509Certificate2Collection.Import(Convert.FromBase64String(this.smimeAdminOptions.SMIMECertificateIssuingCAFull)); x509Store.AddRange(x509Certificate2Collection); chainValidityStatus = X509CertificateCollection.ValidateCertificate(certificate, null, expectedUsage, !flag, x509Store, null, TimeSpan.FromMilliseconds(crlconnectionTimeout), TimeSpan.FromMilliseconds(crlretrievalTimeout), ref chainContext, true, base.CallContext.AccessingPrincipal.MailboxInfo.OrganizationId.ToString()); this.response.PolicyFlag = (uint)this.MapChainStatusToChainFlag(chainValidityStatus); } if (!isSend) { this.response.DisplayedId = this.GetIdFromCertificate(certificate); if (this.response.DisplayedId == null) { chainValidityStatus = ChainValidityStatus.SubjectMismatch; } this.response.DisplayName = X509PartialCertificate.GetDisplayName(certificate); this.response.Issuer = this.GetIssuerDisplayNameFromCertificate(certificate); } } finally { if (chainContext != null) { chainContext.Dispose(); } } this.response.ChainValidityStatus = (uint)chainValidityStatus; return(chainValidityStatus); }
public ScopeFlightsSettingsProvider() { this.variantConfigurationSnapshotFactory = delegate(string scope) { ScopeFlightsSettingsProvider.ScopeConstraintProvider constraintProvider = new ScopeFlightsSettingsProvider.ScopeConstraintProvider(scope); return(VariantConfiguration.GetSnapshot(constraintProvider, null, null)); }; }
// Token: 0x06000003 RID: 3 RVA: 0x00002120 File Offset: 0x00000320 internal AuthAdminContext(string applicationName) : base(OrganizationCapability.Management) { AnchorConfig config = AuthAdminContext.CreateConfigSchema(); AuthAdminLogger logger = new AuthAdminLogger(applicationName, config, new ExEventLog(AuthAdminContext.ComponentGuid, "MSExchange AuthAdmin")); base.Initialize(applicationName, logger, config); this.IsMultiTenancyEnabled = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled; }
public static InstantMessagingConfiguration GetInstance(VdirConfiguration vdirConfiguration) { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.UseVdirConfigForInstantMessaging.Enabled) { return(new InstantMessagingConfiguration(vdirConfiguration)); } return(new InstantMessagingConfiguration(null)); }
private static bool IsIncreasingQuotaEnabled(ADUser user) { if (user != null) { VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(user.GetContext(null), null, null); return(snapshot.Ipaed.IncreaseQuotaForOnHoldMailboxes.Enabled); } return(false); }
private void RegisterFilterForOnPostAuthorize() { if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.ExplicitLogonAuthFilter.Enabled) { this.RegisterFilterForPostAuthorizeRequest(new AlternateMailboxFilterChain()); return; } this.RegisterFilterForPostAuthorizeRequest(new FBASingleSignOnFilterChain()); }
internal static bool IsWorkingSetAgentFeatureEnabled(MiniRecipient miniRecipient) { if (miniRecipient != null) { VariantConfigurationSnapshot snapshot = VariantConfiguration.GetSnapshot(miniRecipient.GetContext(null), null, null); return(snapshot.WorkingSet.WorkingSetAgent.Enabled); } return(false); }
internal static bool ValidateFilteringOnlyUser(string domain, string username) { if (string.IsNullOrEmpty(domain) || !VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ValidateFilteringOnlyUser.Enabled) { return(false); } if (username.EndsWith(".exchangemon.net", StringComparison.InvariantCultureIgnoreCase)) { AuthZLogger.SafeAppendGenericInfo("ValidateFilteringOnlyUser", string.Format("Bypass monitoring account {0} check.", username)); return(false); } bool result; try { bool flag = false; domain = domain.ToLower(); if (!UserValidationHelper.filteringOnlyCache.TryGetValue(domain, out flag)) { CustomerType customerType = CustomerType.None; Guid guid; string text; string text2; UserValidationHelper.GlsSession.GetFfoTenantSettingsByDomain(domain, out guid, out text, out text2, out customerType); flag = (customerType == CustomerType.FilteringOnly); UserValidationHelper.filteringOnlyCache.TryInsertAbsolute(domain, flag, UserValidationHelper.DefaultAbsoluteTimeout); ExTraceGlobals.PublicPluginAPITracer.TraceDebug(0L, "[UserValidationHelper.ValidateFilteringOnlyUser] Domain:{0} belongs to TenantId:{1}, Region:{2}, Version: {3}, CustomerType: {4}.", new object[] { domain, guid, text, text2, customerType }); AuthZLogger.SafeAppendGenericInfo("ValidateFilteringOnlyUser", string.Format("Domain:{0} belongs to TenantId:{1}, Region:{2}, Version: {3}, CustomerType: {4}.", new object[] { domain, guid, text, text2, customerType })); } else { AuthZLogger.SafeAppendGenericInfo("ValidateFilteringOnlyUser", string.Format("HitCache Domain: {0} is filteringOnly: {1}.", domain, flag)); } result = flag; } catch (Exception ex) { ExTraceGlobals.PublicPluginAPITracer.TraceError <Exception>(0L, "[UserValidationHelper.ValidateFilteringOnlyUser] Exception:{0}", ex); AuthZLogger.SafeAppendGenericError("ValidateFilteringOnlyUser", ex, new Func <Exception, bool>(KnownException.IsUnhandledException)); result = false; } return(result); }