Exemplo n.º 1
0
        private void RemoveConfigurationSecureTokenServices()
        {
            try
            {
                XmlDocument stsConfig = new XmlDocument();
                ZimbraConfiguration.GetWebConfig(ZimbraConfiguration.stsServicesConfigPath, ref stsConfig);
                ZimbraConfiguration.RemoveSectionGroupZimbra(ref stsConfig);
                ZimbraConfiguration.RemoveProviderZimbra(ref stsConfig);
                //ZimbraConfiguration.AppendModuleZimbra(ref stsConfig);
                ZimbraConfiguration.SetWebConfig(ZimbraConfiguration.stsServicesConfigPath, ref stsConfig);
                stsConfig = null;

                ZimbraConfiguration.STSAppPool.Recycle();
            }
            catch { }
        }
Exemplo n.º 2
0
        private void AppendConfigurationRootWebServices()
        {
            try
            {
                XmlDocument wsConfig = new XmlDocument();
                ZimbraConfiguration.GetWebConfig(ZimbraConfiguration.rootServicesConfigPath, ref wsConfig);

                List <string> properties = new List <string>();
                foreach (SPFeatureProperty property in configurationproperties)
                {
                    properties.Add(property.Value);
                }

                ZimbraConfiguration.AppendSectionGroupZimbra(ref wsConfig, properties.ToArray());
                //ZimbraConfiguration.AppendSectionGroupZimbra(ref wsConfig,);
                ZimbraConfiguration.AppendProviderZimbra(ref wsConfig);
                //ZimbraConfiguration.AppendModuleZimbra(ref wsConfig);
                ZimbraConfiguration.SetWebConfig(ZimbraConfiguration.rootServicesConfigPath, ref wsConfig);
                wsConfig = null;

                ZimbraConfiguration.WSAppPool.Recycle();

                //while (ZimbraConfiguration.SPServices.State == ObjectState.Starting || ZimbraConfiguration.SPServices.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPServices.State == ObjectState.Started)
                //{
                //    ZimbraConfiguration.SPServices.Stop();
                //}


                //while (ZimbraConfiguration.SPServices.State != ObjectState.Stopped || ZimbraConfiguration.SPServices.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPServices.State == ObjectState.Stopped)
                //{
                //    ZimbraConfiguration.SPServices.Start();
                //}
            }
            catch { }
        }
Exemplo n.º 3
0
        private void RemoveConfigurationCentralAdministration()
        {
            try
            {
                XmlDocument caConfig = new XmlDocument();
                ZimbraConfiguration.GetWebConfig(ZimbraConfiguration.caServicesConfigPath, ref caConfig);
                ZimbraConfiguration.RemoveSectionGroupZimbra(ref caConfig);
                ZimbraConfiguration.RemoveProviderZimbra(ref caConfig);
                ZimbraConfiguration.RemoveModuleZimbra(ref caConfig);
                ZimbraConfiguration.SetWebConfig(ZimbraConfiguration.caServicesConfigPath, ref caConfig);
                caConfig = null;

                ZimbraConfiguration.CAAppPool.Recycle();

                //while (ZimbraConfiguration.SPAdminv4.State == ObjectState.Starting || ZimbraConfiguration.SPAdminv4.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPAdminv4.State == ObjectState.Started)
                //{
                //    ZimbraConfiguration.SPAdminv4.Stop();
                //}


                //while (ZimbraConfiguration.SPAdminv4.State != ObjectState.Stopped || ZimbraConfiguration.SPAdminv4.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPAdminv4.State == ObjectState.Stopped)
                //{
                //    ZimbraConfiguration.SPAdminv4.Start();
                //}
            }
            catch { }
        }
Exemplo n.º 4
0
        private void RemoveConfigurationRootWebServices()
        {
            try
            {
                XmlDocument wsConfig = new XmlDocument();
                ZimbraConfiguration.GetWebConfig(ZimbraConfiguration.rootServicesConfigPath, ref wsConfig);
                ZimbraConfiguration.RemoveSectionGroupZimbra(ref wsConfig);
                ZimbraConfiguration.RemoveProviderZimbra(ref wsConfig);
                //ZimbraConfiguration.AppendModuleZimbra(ref wsConfig);
                ZimbraConfiguration.SetWebConfig(ZimbraConfiguration.rootServicesConfigPath, ref wsConfig);
                wsConfig = null;

                ZimbraConfiguration.WSAppPool.Recycle();

                //while (ZimbraConfiguration.SPServices.State == ObjectState.Starting || ZimbraConfiguration.SPServices.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPServices.State == ObjectState.Started)
                //{
                //    ZimbraConfiguration.SPServices.Stop();
                //}


                //while (ZimbraConfiguration.SPServices.State != ObjectState.Stopped || ZimbraConfiguration.SPServices.State == ObjectState.Stopping)
                //{
                //    System.Threading.Thread.Yield();
                //}

                //if (ZimbraConfiguration.SPServices.State == ObjectState.Stopped)
                //{
                //    ZimbraConfiguration.SPServices.Start();
                //}
            }
            catch { }
        }