Esempio n. 1
0
        // Token: 0x0600011C RID: 284 RVA: 0x00008BF4 File Offset: 0x00006DF4
        private void ConfigureTransportSyncComponent(Server server)
        {
            bool flag  = LogSearchService.IsValidSyncHubHealthLogConfiguration(server);
            bool flag2 = LogSearchService.IsValidSyncMailboxHealthLogConfiguration(server);

            if (flag)
            {
                if (this.syncHealthLogHub == null)
                {
                    this.syncHealthLogHub = this.CreateSyncHealthLogAgent(server.TransportSyncHubHealthLogFilePath.PathName, "SyncHealthHub", server.Name);
                }
                else
                {
                    this.syncHealthLogHub.ChangePath(server.TransportSyncHubHealthLogFilePath.PathName);
                    ExTraceGlobals.ServiceTracer.TraceDebug <string>((long)this.GetHashCode(), "Updating the Sync Hub Health Log Path to: {0}", server.TransportSyncHubHealthLogFilePath.PathName);
                }
            }
            if (flag2)
            {
                if (this.syncHealthLogMailbox == null)
                {
                    this.syncHealthLogMailbox = this.CreateSyncHealthLogAgent(server.TransportSyncMailboxHealthLogFilePath.PathName, "SyncHealthMailbox", server.Name);
                    return;
                }
                this.syncHealthLogMailbox.ChangePath(server.TransportSyncMailboxHealthLogFilePath.PathName);
                ExTraceGlobals.ServiceTracer.TraceDebug <string>((long)this.GetHashCode(), "Updating the Sync Mailbox Health Log Path to: {0}", server.TransportSyncMailboxHealthLogFilePath.PathName);
            }
        }
Esempio n. 2
0
        // Token: 0x06000110 RID: 272 RVA: 0x00008194 File Offset: 0x00006394
        public static void Main(string[] args)
        {
            int num = Privileges.RemoveAllExcept(new string[]
            {
                "SeAuditPrivilege",
                "SeChangeNotifyPrivilege",
                "SeCreateGlobalPrivilege"
            });

            if (num != 0)
            {
                Environment.Exit(num);
            }
            if (!Debugger.IsAttached)
            {
                ExWatson.Register();
            }
            LogSearchService.runningAsService = !Environment.UserInteractive;
            bool flag  = false;
            bool flag2 = false;

            foreach (string text in args)
            {
                if (text.StartsWith("-?", StringComparison.Ordinal))
                {
                    LogSearchService.Usage();
                    Environment.Exit(0);
                }
                else if (text.StartsWith("-console"))
                {
                    flag = true;
                }
                else if (text.StartsWith("-wait"))
                {
                    flag2 = true;
                }
            }
            Globals.InitializeMultiPerfCounterInstance("LogSearchSvc");
            ADSession.DisableAdminTopologyMode();
            if (!LogSearchService.runningAsService)
            {
                if (!flag)
                {
                    LogSearchService.Usage();
                    Environment.Exit(0);
                }
                Console.WriteLine("Starting {0}, running in console mode.", Assembly.GetExecutingAssembly().GetName().Name);
                if (flag2)
                {
                    Console.WriteLine("Press ENTER to continue.");
                    Console.ReadLine();
                }
            }
            SettingOverrideSync.Instance.Start(true);
            if (!VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Transport.ADExceptionHandling.Enabled)
            {
                LogSearchService.logSearchService = new LogSearchService(!LogSearchService.runningAsService);
            }
            else
            {
                ADOperationResult adoperationResult = ADNotificationAdapter.TryRunADOperation(delegate()
                {
                    LogSearchService.logSearchService = new LogSearchService(!LogSearchService.runningAsService);
                }, 0);
                if (!adoperationResult.Succeeded)
                {
                    ExTraceGlobals.ServiceTracer.TraceError <Exception>(0L, "Create Log Search Service failed: {0}", adoperationResult.Exception);
                    Environment.Exit(1);
                }
            }
            try
            {
                Kerberos.FlushTicketCache();
            }
            catch (Win32Exception arg)
            {
                ExTraceGlobals.ServiceTracer.TraceDebug <Win32Exception>(0L, "MsExchangeLogSearch caught a Win32Exception when flushing the Kerberos Ticket Cache at startup: {0}", arg);
            }
            if (!LogSearchService.runningAsService)
            {
                LogSearchService.logSearchService.OnStartInternal(args);
                bool flag3 = false;
                while (!flag3)
                {
                    Console.WriteLine("Enter 'q' to shutdown.");
                    string text2 = Console.ReadLine();
                    if (string.IsNullOrEmpty(text2))
                    {
                        break;
                    }
                    switch (text2[0])
                    {
                    case 'q':
                        flag3 = true;
                        break;

                    case 's':
                        LogSearchService.logSearchService.sessionManager.ShowSessions();
                        break;
                    }
                }
                Console.WriteLine("Shutting down ...");
                LogSearchService.logSearchService.OnStopInternal();
                Console.WriteLine("Done.");
                return;
            }
            ServiceBase.Run(LogSearchService.logSearchService);
        }