Beispiel #1
0
        static int RunReporterVerb(ReporterOptions options)
        {
            if (options.ScanType.ToUpper() == "SMB")
            {
                Dictionary <string, SMBHost> hosts;
                SetCommonOptions(options);

                if (File.Exists(options.InputFile))
                {
                    hosts = SMBSharesMapperSerializer.DeserializeHosts(options.InputFile);
                    if (hosts == null)
                    {
                        return(-1);
                    }

                    if (options.OutReport.Length > 0)
                    {
                        if (File.Exists(options.SIDFile))
                        {
                            ReportGenerator.XLSXReport.LoadSIDResolutionFile(options.SIDFile);
                        }
                        ReportGenerator.XLSXReport.GenerateSMBHostsReport(hosts, options.OutReport);
                        ReportGenerator.XLSXReport.SIDCahe.Clear();
                    }
                }
            }
            return(0);
        }
Beispiel #2
0
 public AlertReporter(IOptions <ReporterOptions> options, TermoHubContext context, IEmailSender emailSender)
 {
     this.options     = options.Value;
     this.context     = context;
     this.emailSender = emailSender;
 }