Ejemplo n.º 1
0
        /// <summary>
        /// GetSIDsInformations method implmentation
        /// </summary>
        public static SIDsParametersRecord GetSIDsInformations(MFAConfig config)
        {
            // if (ClientSIDsProxy.Loaded)
            //     return ClientSIDsProxy.Record;
            WebAdminClient manager = new WebAdminClient();

            manager.Initialize();
            try
            {
                IWebAdminServices client = manager.Open();
                try
                {
                    return(client.GetSIDsInformations(GetServers(config)));
                }
                catch (Exception)
                {
                    return(new SIDsParametersRecord()
                    {
                        Loaded = false
                    });
                }
                finally
                {
                    manager.Close(client);
                }
            }
            finally
            {
                manager.UnInitialize();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// InitSecurityFile method implementation
        /// </summary>
        protected void InitSecurityFile()
        {
            string         fqdn    = Dns.GetHostEntry("localhost").HostName;
            WebAdminClient manager = new WebAdminClient();

            manager.Initialize();
            try
            {
                MFAConfig         config = CFGReaderUtilities.ReadConfiguration();
                IWebAdminServices client = manager.Open();
                try
                {
                    SIDs.Clear();
                    SIDs.Assign(client.GetSIDsInformations(GetServers(config)));
                    SIDs.InternalUpdateDirectoryACLs(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + Path.DirectorySeparatorChar + "MFA");
                }
                catch (Exception ex)
                {
                    Log.WriteEntry(string.Format("Error on WebAdminService Service GetSIDsInformations method : {0} / {1}.", fqdn, ex.Message), EventLogEntryType.Error, 2010);
                    SIDs.Assign(new SIDsParametersRecord()
                    {
                        Loaded = false
                    });
                }
                finally
                {
                    manager.Close(client);
                }
            }
            catch (Exception e)
            {
                Log.WriteEntry(string.Format("Error on WebAdminService Service GetSIDsInformations method : {0} / {1}.", fqdn, e.Message), EventLogEntryType.Error, 2010);
            }
            finally
            {
                manager.UnInitialize();
            }
            return;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// GetSIDsInformations method implmentation
        /// </summary>
        public static SIDsParametersRecord GetSIDsInformations(MFAConfig config)
        {
            string         fqdn    = Dns.GetHostEntry("localhost").HostName;
            WebAdminClient manager = new WebAdminClient();

            manager.Initialize();
            try
            {
                IWebAdminServices client = manager.Open();
                try
                {
                    return(client.GetSIDsInformations(GetServers(config)));
                }
                catch (Exception ex)
                {
                    Log.WriteEntry(string.Format("Error on WebAdminService Service GetSIDsInformations method : {0} / {1}.", fqdn, ex.Message), EventLogEntryType.Error, 2010);
                    return(new SIDsParametersRecord()
                    {
                        Loaded = false
                    });
                }
                finally
                {
                    manager.Close(client);
                }
            }
            catch (Exception e)
            {
                Log.WriteEntry(string.Format("Error on WebAdminService Service GetSIDsInformations method : {0} / {1}.", fqdn, e.Message), EventLogEntryType.Error, 2010);
            }
            finally
            {
                manager.UnInitialize();
            }
            return(null);
        }