Ejemplo n.º 1
0
 static SetExchangeSettings()
 {
     SetExchangeSettings.AddRegisteredSchema(new MRSConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new ConfigurationADImpl.ADCacheConfigurationSchema());
     SetExchangeSettings.AddRegisteredSchema(new TenantRelocationConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new LoadBalanceADSettings());
     SetExchangeSettings.AddRegisteredSchema(new TenantDataCollectorConfig());
     SetExchangeSettings.AddRegisteredSchema(new UpgradeBatchCreatorConfig());
     SetExchangeSettings.AddRegisteredSchema(new UpgradeHandlerConfig());
     SetExchangeSettings.AddRegisteredSchema(new SlimTenantConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new TenantUpgradeConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new AdDriverConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new MRSRecurrentOperationConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new DirectoryTasksConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new ProvisioningTasksConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new PluggableDivergenceHandlerConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new MigrationServiceConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new ComplianceConfigSchema());
     SetExchangeSettings.AddRegisteredSchema(new OlcConfigSchema());
     SetExchangeSettings.SchemaAssemblyMap.Add("Store", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.Server.Storage.Common.dll", "Microsoft.Exchange.Server.Storage.Common.StoreConfigSchema"));
     SetExchangeSettings.SchemaAssemblyMap.Add("MigrationMonitor", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.MigrationMonitor.dll", "Microsoft.Exchange.Servicelets.MigrationMonitor.MigrationMonitor+MigrationMonitorConfig"));
     SetExchangeSettings.SchemaAssemblyMap.Add("UpgradeInjector", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.UpgradeInjector.dll", "Microsoft.Exchange.Servicelets.Upgrade.UpgradeInjector+UpgradeInjectorConfig"));
     SetExchangeSettings.SchemaAssemblyMap.Add("AuthAdmin", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.AuthAdminServicelet.dll", "Microsoft.Exchange.Servicelets.AuthAdmin.AuthAdminContext+AuthAdminConfig"));
     SetExchangeSettings.SchemaAssemblyMap.Add("ServiceHost", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.ServiceHost.exe", "Microsoft.Exchange.ServiceHost.ServiceHostConfigSchema"));
     SetExchangeSettings.SchemaAssemblyMap.Add("SlowMRSDetector", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.MRS.SlowMRSDetector.dll", "Microsoft.Exchange.Servicelets.MRS.SlowMRSDetectorContext+SlowMRSDetectorConfig"));
     SetExchangeSettings.SchemaAssemblyMap.Add("DrumTesting", new SetExchangeSettings.SchemaAssembly("Microsoft.Exchange.DrumTesting.exe", "Microsoft.Exchange.DrumTesting.DrumConfigSchema"));
     SetExchangeSettings.SchemaAssemblyMap.Add("BatchCreator", new SetExchangeSettings.SchemaAssembly("MSExchangeMigrationWorkflow.exe", "Microsoft.Exchange.Servicelets.BatchCreator.BatchCreatorConfig"));
 }
Ejemplo n.º 2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.GuidMatch != null && this.NameMatch != null)
     {
         base.WriteError(new RecipientTaskException(Strings.ExchangeSettingsGuidUsage), ExchangeErrorCategory.Client, this.DataObject);
     }
     this.PrivateValidate(SetExchangeSettings.GetRegisteredSchema(this.Identity.ToString(), this.Force, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskErrorLoggingDelegate(base.WriteError)));
     TaskLogger.LogExit();
 }
Ejemplo n.º 3
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ExchangeSettings exchangeSettings = (ExchangeSettings)base.PrepareDataObject();

            if (base.HasErrors)
            {
                return(null);
            }
            if (!this.Force && !SetExchangeSettings.IsSchemaRegistered(base.Name))
            {
                base.WriteError(new ExchangeSettingsInvalidSchemaException(base.Name), ErrorCategory.InvalidOperation, null);
            }
            exchangeSettings.SetId(this.ConfigurationSession, base.Name);
            exchangeSettings.InitializeSettings();
            TaskLogger.LogExit();
            return(exchangeSettings);
        }
Ejemplo n.º 4
0
        protected override void WriteResult(IConfigurable dataObject)
        {
            TaskLogger.LogEnter(new object[]
            {
                dataObject.Identity,
                dataObject
            });
            ExchangeSettings         exchangeSettings         = (ExchangeSettings)dataObject;
            ConfigDiagnosticArgument configDiagnosticArgument = new ConfigDiagnosticArgument(this.DiagnosticArgument);

            if (configDiagnosticArgument.HasArgument("force"))
            {
                this.Force = true;
            }
            if (string.IsNullOrEmpty(this.ConfigName) && configDiagnosticArgument.HasArgument("configname"))
            {
                this.ConfigName = configDiagnosticArgument.GetArgument <string>("configname");
            }
            if (exchangeSettings != null)
            {
                ConfigSchemaBase schema = null;
                if (SetExchangeSettings.IsSchemaRegistered(exchangeSettings.Identity.ToString()))
                {
                    schema = SetExchangeSettings.GetRegisteredSchema(exchangeSettings.Identity.ToString(), this.Force, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskErrorLoggingDelegate(base.WriteError));
                }
                if (exchangeSettings.Groups != null)
                {
                    foreach (SettingsGroup settingsGroup in exchangeSettings.Groups)
                    {
                        try
                        {
                            settingsGroup.Validate(schema, null);
                        }
                        catch (ConfigurationSettingsException ex)
                        {
                            base.WriteWarning(ex.Message);
                        }
                    }
                }
                this.ProcessDiagnostic(exchangeSettings, configDiagnosticArgument, schema);
            }
            base.WriteResult(exchangeSettings);
            TaskLogger.LogExit();
        }
Ejemplo n.º 5
0
        internal static ConfigSchemaBase GetRegisteredSchema(string identity, bool force, Task.TaskVerboseLoggingDelegate writeVerbose, Task.TaskErrorLoggingDelegate writeError)
        {
            ConfigSchemaBase configSchemaBase = null;

            if (force || SetExchangeSettings.RegisteredSchemas.TryGetValue(identity, out configSchemaBase))
            {
                return(configSchemaBase);
            }
            SetExchangeSettings.SchemaAssembly schemaAssembly;
            if (!SetExchangeSettings.SchemaAssemblyMap.TryGetValue(identity, out schemaAssembly))
            {
                writeError(new ExchangeSettingsInvalidSchemaException(identity), ErrorCategory.InvalidOperation, null);
            }
            string text = Path.Combine(ConfigurationContext.Setup.InstallPath, "bin", schemaAssembly.ModuleName);

            writeVerbose(new LocalizedString(string.Format("Attempting to load schema for {0} from {1}", identity, text)));
            try
            {
                Assembly assembly = Assembly.LoadFrom(text);
                configSchemaBase = (ConfigSchemaBase)assembly.CreateInstance(schemaAssembly.TypeName, true, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, null, null, null);
                if (configSchemaBase == null)
                {
                    writeVerbose(new LocalizedString(string.Format("Assembly {0} found but type {1} could not get loaded", text, schemaAssembly.TypeName)));
                    writeError(new ExchangeSettingsInvalidSchemaException(identity), ErrorCategory.InvalidOperation, null);
                }
                if (string.Compare(configSchemaBase.Name, identity, StringComparison.InvariantCulture) != 0)
                {
                    writeVerbose(new LocalizedString(string.Format("identity used {0} does not match identity found on schema {1}", identity, configSchemaBase.Name)));
                    writeError(new ExchangeSettingsInvalidSchemaException(identity), ErrorCategory.InvalidOperation, null);
                }
                SetExchangeSettings.AddRegisteredSchema(configSchemaBase);
                return(configSchemaBase);
            }
            catch (FileNotFoundException)
            {
                writeError(new ExchangeSettingsAssemblyNotFoundException(identity, text, schemaAssembly.TypeName), ErrorCategory.InvalidOperation, null);
            }
            return(null);
        }