Ejemplo n.º 1
0
        private InitializeWMICollection DoAction()
        {
            WMIMachineInfo machineInfo = InitParamCollection(IsRefresh);

            machineInfo.CommandMode = EnumHelper.Mode.Action;


            ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection();

            Boolean result = ReportObject.CollectReport(machineInfo);

            return(ReportObject);
        }
Ejemplo n.º 2
0
        private void StartRemoteAction(RemoteActionInfo remoteActionInfo)
        {
            try
            {
                WMIMachineInfo machineInfo = new WMIMachineInfo();

                machineInfo.ServersList = remoteActionInfo.Machines;

                machineInfo.CommandMode      = EnumHelper.Mode.Action;
                machineInfo.backgroundWorker = progressDialog.worker;

                machineInfo.MachineConnectionInfo = new WMIConnectionInfo()
                {
                    ReportMode = EnumHelper.OperationMode.Interactive,


                    DatabaseConnectionInfo = Utility.LoadDbConnectionInfo(),
                };

                if (remoteActionInfo.RemoteAction == EnumHelper.RemoteAction.RemoteInstall)
                {
                    machineInfo.MachineConnectionInfo.ReportCategory = EnumHelper.WMIReportCategory.Application;
                    machineInfo.ActionName = "Install";
                }
                else if (remoteActionInfo.RemoteAction == EnumHelper.RemoteAction.RemoteReboot)
                {
                    machineInfo.MachineConnectionInfo.ReportCategory = EnumHelper.WMIReportCategory.OperatingSystem;
                    machineInfo.ActionName = "Reboot";
                }

                else if (remoteActionInfo.RemoteAction == EnumHelper.RemoteAction.RemoteShutDown)
                {
                    machineInfo.MachineConnectionInfo.ReportCategory = EnumHelper.WMIReportCategory.OperatingSystem;
                    machineInfo.ActionName = "Shutdown";
                }

                machineInfo.RemoteActionInfo = remoteActionInfo;


                ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection();

                Boolean result = ReportObject.CollectReport(machineInfo);
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }
        }
Ejemplo n.º 3
0
        private InitializeWMICollection DoReportCollection(List <MachineInfo> machineItems, Boolean IsRefresh = false)
        {
            try
            {
                WMIMachineInfo machineInfo = InitParamCollection(machineItems, IsRefresh);

                machineInfo.backgroundWorker = progressDialog.worker;

                Boolean result = ReportObject.CollectReport(machineInfo);
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }


            return(ReportObject);
        }
Ejemplo n.º 4
0
        private InitializeWMICollection DoReportCollection(Boolean IsRefresh = false)
        {
            try
            {
                WMIMachineInfo machineInfo = InitParamCollection(IsRefresh);


                ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection();

                Boolean result = ReportObject.CollectReport(machineInfo);
            }
            catch (Exception)
            {
                throw;
            }


            return(ReportObject);
        }
Ejemplo n.º 5
0
        private InitializeWMICollection DoAction(List <MachineInfo> machineInfoItems, Boolean IsRefresh)
        {
            try
            {
                WMIMachineInfo machineInfo = InitParamCollection(machineInfoItems, IsRefresh);

                machineInfo.CommandMode = EnumHelper.Mode.Action;
                //machineInfo.OwnerHandle = this.Handle;

                ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection();

                Boolean result = ReportObject.CollectReport(machineInfo);
            }
            catch (Exception ex)
            {
                AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error);
            }

            return(ReportObject);
        }
Ejemplo n.º 6
0
        public Boolean InitManager(EnumHelper.WMIReportCategory reportCategory)
        {
            Boolean result = false;

            try
            {
                this.ReportCategory = reportCategory;

                ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection();

                GetTaskDetails(taskName);

                result = ReportObject.CollectReport(wmiMachineInfo);

                ExportInfo exportInfo = new ExportInfo()
                {
                    ReportDetails = new ReportInfo()
                    {
                        ExportFormat = EnumHelper.ExportFormat.HTML.ToString(), ReportName = ReportCategory.ToString(), GeneratorName = "Adminstrator", ProductName = "AMT", ReportDate = DateTime.Now.ToString(), ExportPath = Path.Combine(@"C:\Users\Public\Documents\AMT\Preview")
                    },
                    MachineInfo = wmiMachineInfo
                };


                exportInfo.ReportDetails.ExportPath = System.IO.Path.Combine(exportInfo.ReportDetails.ExportPath, Utility.GetTimeStamp());

                if (!System.IO.Directory.Exists(exportInfo.ReportDetails.ExportPath))
                {
                    System.IO.Directory.CreateDirectory(exportInfo.ReportDetails.ExportPath);
                }

                ReportObject.ExportReportData(exportInfo);
            }
            catch (Exception)
            {
                throw;
            }

            return(result);
        }