예제 #1
0
        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);
                }
            }
        }
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            ADOwaVirtualDirectory adowaVirtualDirectory = WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADOwaVirtualDirectory>(this.DataObject, base.DataSession);

            if (adowaVirtualDirectory != null)
            {
                WebAppVirtualDirectoryHelper.CheckTwoWebAppVirtualDirectories(this.DataObject, adowaVirtualDirectory, new Action <string>(base.WriteWarning), Strings.EcpAuthenticationNotMatchOwaWarning, Strings.EcpUrlNotMatchOwaWarning);
            }
            else
            {
                this.WriteWarning(Strings.CreateOwaForEcpWarning);
            }
            if (this.DataObject.IsChanged(ADEcpVirtualDirectorySchema.AdminEnabled) || this.DataObject.IsChanged(ADEcpVirtualDirectorySchema.OwaOptionsEnabled))
            {
                this.WriteWarning(Strings.NeedIisRestartForChangingECPFeatureWarning);
            }
            base.InternalProcessRecord();
            ADEcpVirtualDirectory dataObject = this.DataObject;

            WebAppVirtualDirectoryHelper.UpdateMetabase(dataObject, dataObject.MetabasePath, true);
            if (!ExchangeServiceVDirHelper.IsBackEndVirtualDirectory(this.DataObject) && base.Fields.Contains("FormsAuthentication"))
            {
                ExchangeServiceVDirHelper.UpdateFrontEndHttpModule(this.DataObject, this.FormsAuthentication);
            }
            if (base.Fields.Contains("AdfsAuthentication"))
            {
                ExchangeServiceVDirHelper.SetAdfsAuthenticationModule(this.DataObject.AdfsAuthentication, false, this.DataObject);
            }
            TaskLogger.LogExit();
        }
예제 #3
0
 protected override void WriteResultMetabaseFixup(ExchangeVirtualDirectory targetDataObject)
 {
     base.WriteResultMetabaseFixup(targetDataObject);
     if (WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADEcpVirtualDirectory>((ExchangeWebAppVirtualDirectory)targetDataObject, base.DataSession) == null)
     {
         this.WriteWarning(Strings.CreateEcpForOwaWarning);
     }
 }
        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);
        }
예제 #5
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (base.HasErrors)
            {
                return;
            }
            ADOwaVirtualDirectory dataObject = this.DataObject;

            if (dataObject.ExchangeVersion.IsOlderThan(ADOwaVirtualDirectory.MinimumSupportedExchangeObjectVersion))
            {
                base.WriteError(new TaskException(Strings.ErrorSetOlderVirtualDirectory(dataObject.Identity.ToString(), dataObject.ExchangeVersion.ToString(), ADOwaVirtualDirectory.MinimumSupportedExchangeObjectVersion.ToString())), ErrorCategory.InvalidArgument, null);
            }
            if (dataObject.WebReadyFileTypes != null)
            {
                foreach (string text in dataObject.WebReadyFileTypes)
                {
                    if (!dataObject.WebReadyDocumentViewingSupportedFileTypes.Contains(text.ToLower()))
                    {
                        PropertyValidationError error     = new PropertyValidationError(DataStrings.ConstraintViolationValueIsNotInGivenStringArray(string.Join(",", dataObject.WebReadyDocumentViewingSupportedFileTypes.ToArray()), text), ADOwaVirtualDirectorySchema.WebReadyFileTypes, dataObject.WebReadyFileTypes);
                        DataValidationException exception = new DataValidationException(error);
                        base.WriteError(exception, ErrorCategory.InvalidArgument, this.DataObject.Identity);
                    }
                }
            }
            if (dataObject.WebReadyMimeTypes != null)
            {
                foreach (string text2 in dataObject.WebReadyMimeTypes)
                {
                    if (!dataObject.WebReadyDocumentViewingSupportedMimeTypes.Contains(text2.ToLower()))
                    {
                        PropertyValidationError error2     = new PropertyValidationError(DataStrings.ConstraintViolationValueIsNotInGivenStringArray(string.Join(",", dataObject.WebReadyDocumentViewingSupportedMimeTypes.ToArray()), text2), ADOwaVirtualDirectorySchema.WebReadyMimeTypes, dataObject.WebReadyMimeTypes);
                        DataValidationException exception2 = new DataValidationException(error2);
                        base.WriteError(exception2, ErrorCategory.InvalidArgument, this.DataObject.Identity);
                    }
                }
            }
            if (dataObject.InstantMessagingType == InstantMessagingTypeOptions.Msn && !Datacenter.IsMultiTenancyEnabled())
            {
                base.WriteError(new TaskException(Strings.ErrorMsnIsNotSupportedInEnterprise), ErrorCategory.InvalidArgument, null);
            }
            if (base.Fields.Contains("AdfsAuthentication") && this.DataObject.AdfsAuthentication)
            {
                ADEcpVirtualDirectory adecpVirtualDirectory = WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADEcpVirtualDirectory>(this.DataObject, base.DataSession);
                if (adecpVirtualDirectory == null || !adecpVirtualDirectory.AdfsAuthentication)
                {
                    base.WriteError(new TaskException(Strings.CannotConfigureAdfsOwaWithoutEcpFirst), ErrorCategory.InvalidOperation, null);
                }
            }
        }
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (base.HasErrors)
     {
         return;
     }
     if (base.Fields.Contains("AdfsAuthentication") && !this.DataObject.AdfsAuthentication)
     {
         ADOwaVirtualDirectory adowaVirtualDirectory = WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADOwaVirtualDirectory>(this.DataObject, base.DataSession);
         if (adowaVirtualDirectory != null && adowaVirtualDirectory.AdfsAuthentication)
         {
             base.WriteError(new TaskException(Strings.CannotDisableAdfsEcpWithoutOwaFirst), ErrorCategory.InvalidOperation, null);
         }
     }
 }
예제 #7
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            bool flag = false;
            ADEcpVirtualDirectory adecpVirtualDirectory = WebAppVirtualDirectoryHelper.FindWebAppVirtualDirectoryInSameWebSite <ADEcpVirtualDirectory>(this.DataObject, base.DataSession);

            if (adecpVirtualDirectory != null)
            {
                if (this.DataObject.IsChanged(ExchangeWebAppVirtualDirectorySchema.DefaultDomain))
                {
                    adecpVirtualDirectory.DefaultDomain = this.DataObject.DefaultDomain;
                    flag = true;
                }
                WebAppVirtualDirectoryHelper.CheckTwoWebAppVirtualDirectories(this.DataObject, adecpVirtualDirectory, new Action <string>(base.WriteWarning), Strings.OwaAuthenticationNotMatchEcpWarning, Strings.OwaUrlNotMatchEcpWarning);
            }
            else
            {
                this.WriteWarning(Strings.CreateEcpForOwaWarning);
            }
            if (this.DataObject.IsChanged(ADOwaVirtualDirectorySchema.AnonymousFeaturesEnabled))
            {
                this.UpdateCalendarMetabase(this.DataObject);
            }
            if (this.DataObject.IsChanged(ADOwaVirtualDirectorySchema.IntegratedFeaturesEnabled))
            {
                this.UpdateIntegratedMetabase(this.DataObject);
            }
            if (this.DataObject.IsChanged(ExchangeWebAppVirtualDirectorySchema.LiveIdAuthentication))
            {
                this.UpdateOmaMetabase(this.DataObject);
            }
            base.InternalProcessRecord();
            ADOwaVirtualDirectory dataObject = this.DataObject;
            bool flag2 = ExchangeServiceVDirHelper.IsBackEndVirtualDirectory(this.DataObject);

            if (dataObject.LiveIdAuthentication)
            {
                WebAppVirtualDirectoryHelper.UpdateMetabase(dataObject, dataObject.MetabasePath, true);
            }
            else
            {
                WebAppVirtualDirectoryHelper.UpdateMetabase(dataObject, dataObject.MetabasePath, flag2);
            }
            if (flag)
            {
                WebAppVirtualDirectoryHelper.UpdateMetabase(adecpVirtualDirectory, adecpVirtualDirectory.MetabasePath, true);
            }
            if (flag2)
            {
                ExchangeServiceVDirHelper.EwsAutodiscMWA.OnSetManageWCFEndpoints(this, ExchangeServiceVDirHelper.EwsAutodiscMWA.EndpointProtocol.OwaEws, false, this.DataObject);
            }
            else if (base.Fields.Contains("FormsAuthentication"))
            {
                ExchangeServiceVDirHelper.UpdateFrontEndHttpModule(this.DataObject, this.FormsAuthentication);
            }
            if (base.Fields.Contains("OAuthAuthentication"))
            {
                ExchangeServiceVDirHelper.SetOAuthAuthenticationModule(this.DataObject.OAuthAuthentication, false, this.DataObject);
            }
            if (base.Fields.Contains("AdfsAuthentication"))
            {
                ExchangeServiceVDirHelper.SetAdfsAuthenticationModule(this.DataObject.AdfsAuthentication, false, this.DataObject);
            }
            TaskLogger.LogExit();
        }