private Dictionary <string, string> Save() { string InvocationTimeStamp = DateTime.Now.ToString("yyyyMMddHHmmss"); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("MappingFile", NuixO365PstPusherMappingFileTextBox.Text); parameters.Add("ExportDirectory", this.NuixO365PstPusherExportDirectoryTextBox.Text); parameters.Add("RunName", NuixO365PstPusherRunNameTextBox.Text); parameters.Add("CasePath", NuixO365PstPusherCasePathTextBox.Text); parameters.Add("NuixWorkers", NuixO365PstPusherNuixWorkersTextBox.Text); parameters.Add("ApplicationMemory", NuixO365PstPusherApplicationMemoryTextBox.Text); parameters.Add("WorkerMemory", NuixO365PstPusherWorkerMemoryTextBox.Text); parameters.Add("MaintainSourceFolderStructure", NuixO365PstPusherMaintainSourceFolderStructureCheckBox.Checked.ToString()); parameters.Add("IsEnterpriseSourceData", NuixO365PstPusherEnterpriseVaultSourceDataCheckBox.Checked.ToString()); parameters.Add("ServiceAccountConfiguredForImpersonation", NuixO365PstPusherServiceAccountIsConfiguredForImpersonationCheckBox.Checked.ToString()); string[] save = new string[] { "MappingFile=" + parameters["MappingFile"], "ExportDirectory=" + parameters["ExportDirectory"], "RunName=" + parameters["RunName"], "CasePath=" + parameters["CasePath"], "NuixWorkers=" + parameters["NuixWorkers"], "ApplicationMemory=" + parameters["ApplicationMemory"], "WorkerMemory=" + parameters["WorkerMemory"], "MaintainSourceFolderStructure=" + parameters["MaintainSourceFolderStructure"], "IsEnterpriseSourceData=" + parameters["IsEnterpriseSourceData"], "ServiceAccountConfiguredForImpersonation=" + parameters["ServiceAccountConfiguredForImpersonation"] }; System.IO.File.WriteAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PSTPusherNode\\PstPusher.save", save); List <string> bat = new List <string>(); foreach (string row in File.ReadAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PSTPusherNode\\Process PSTs to EWS_config.bat.template")) { string updated; if (row.Contains("[NuixWorkstationDirectory]")) { updated = row + " " + NuixCommandConsole.GetNuixLicense(); } else { continue; } updated = updated.Replace("[NuixWorkstationDirectory]", NuixCommandConsole.GetNuixWorkstationDirectory()); updated = updated.Replace("[ApplicationMemory]", parameters["ApplicationMemory"]); updated = updated.Replace("[NuixLogDir]", NuixCommandConsole.GetNuixLogDirectory() + "\\" + this.NuixO365PstPusherRunNameTextBox.Text + "-" + InvocationTimeStamp); updated = updated.Replace("[NuixTempDir]", NuixCommandConsole.GetNuixTempDirectory()); updated = updated.Replace("[MappingFile]", parameters["MappingFile"]); updated = updated.Replace("[ExportDirectory]", parameters["ExportDirectory"] + "\\" + this.NuixO365PstPusherRunNameTextBox.Text + "-" + InvocationTimeStamp); updated = updated.Replace("[MaintainSourceFolderStructure]", parameters["MaintainSourceFolderStructure"]); updated = updated.Replace("[ServiceAccountConfiguredForImpersonation]", parameters["ServiceAccountConfiguredForImpersonation"]); if (bool.Parse(parameters["IsEnterpriseSourceData"])) { updated = updated.Replace("[EnterpriseValueSourceData]", "2"); } else { updated = updated.Replace("[EnterpriseValueSourceData]", "1"); } bat.Add(updated); } System.IO.File.WriteAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PSTPusherNode\\Process PSTs to EWS_config.bat", bat); List <string> SystemProperties = new List <string>(); foreach (string row in File.ReadAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PSTPusherNode\\System_Properties.rb_.template")) { string updated = row.Replace("[RUNNAME]", parameters["RunName"]); updated = updated.Replace("[CASEPATH]", parameters["CasePath"]); updated = updated.Replace("[WORKERCOUNT]", parameters["NuixWorkers"]); updated = updated.Replace("[WORKERMEMORY]", parameters["WorkerMemory"]); updated = updated.Replace("[WORKERTEMP]", NuixCommandConsole.GetNuixTempDirectory()); SystemProperties.Add(updated); } System.IO.File.WriteAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PSTPusherNode\\System_Properties.rb_", SystemProperties); return(parameters); }
private Dictionary <string, string> Save() { string InvocationTimeStamp = DateTime.Now.ToString("yyyyMMddHHmmss"); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("RootCasesDirectory", RootCasesDirectoryTextBox.Text); parameters.Add("OutputDirectory", OutputDirectoryTextBox.Text); parameters.Add("CollectorExecutable", CollectorExecutableTextBox.Text); parameters.Add("Scope", ScopeTextBox.Text); parameters.Add("VerificationOne", VerificationOneCheckBox.Checked.ToString()); parameters.Add("Username", UsernameTextBox.Text); parameters.Add("Domain", DomainTextBox.Text); parameters.Add("Password", PasswordTextBox.Text); parameters.Add("ScrambleCreationDate", ScrambleCreationDateCheckBox.Checked.ToString()); parameters.Add("ScrambleAccessDate", ScrambleAccessDateCheckBox.Checked.ToString()); parameters.Add("ScrambleModificationDate", ScrambleModificationDateCheckbox.Checked.ToString()); parameters.Add("DeleteFolders", DeleteFoldersCheckBox.Checked.ToString()); parameters.Add("OverwriteCount", OverwriteCountComboBox.GetItemText(OverwriteCountComboBox.SelectedItem)); parameters.Add("VerificationTwo", VerificationTwoCheckBox.Checked.ToString()); parameters.Add("VerifyCreationDate", VerifyCreationDateCheckBox.Checked.ToString()); parameters.Add("VerifySize", VerifySizeCheckBox.Checked.ToString()); parameters.Add("VerifyModificationDate", VerifyModificationDateCheckBox.Checked.ToString()); parameters.Add("VerifyMD5Hash", VerifyMD5HashCheckBox.Checked.ToString()); parameters.Add("VerifyAccessDate", VerifyAccessDateCheckBox.Checked.ToString()); parameters.Add("ValidateJobFileXML", ValidateJobFileXMLCheckBox.Checked.ToString()); parameters.Add("SendNotifications", SendNotificationsCheckBox.Checked.ToString()); parameters.Add("NotificationTargets", SendNotificationsTextBox.Text); string [] save = new string [] { "RootCasesDirectory=" + parameters["RootCasesDirectory"], "OutputDirectory=" + parameters["OutputDirectory"], "CollectorExecutable=" + parameters["CollectorExecutable"], "Scope=" + parameters["Scope"], "VerificationOne=" + parameters["VerificationOne"], "Username="******"Username"], "Domain=" + parameters["Domain"], "Password="******"Password"])), "ScrambleCreationDate=" + parameters["ScrambleCreationDate"], "ScrambleAccessDate=" + parameters["ScrambleAccessDate"], "ScrambleModificationDate=" + parameters["ScrambleModificationDate"], "DeleteFolders=" + parameters["DeleteFolders"], "OverwriteCount=" + parameters["OverwriteCount"], "VerificationTwo=" + parameters["VerificationTwo"], "VerifyCreationDate=" + parameters["VerifyCreationDate"], "VerifySize=" + parameters["VerifySize"], "VerifyModificationDate=" + parameters["VerifyModificationDate"], "VerifyMD5Hash=" + parameters["VerifyMD5Hash"], "VerifyAccessDate=" + parameters["VerifyAccessDate"], "ValidateJobFileXML=" + parameters["ValidateJobFileXML"], "SendNotifications=" + parameters["SendNotifications"], "NotificationTargets=" + parameters["NotificationTargets"] }; System.IO.File.WriteAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PhysicalFileDeletionNode\\PhysicalFileDeletionNode.save", save); string JobFileTemplate = System.IO.File.ReadAllText(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PhysicalFileDeletionNode\\DefensibleForensicDeletionTemplate.xml"); JobFileTemplate = JobFileTemplate.Replace("~OVERWRITECOUNT~", parameters["OverwriteCount"]) .Replace("~SCRAMBLECREATIONDATE~", YesOrNo(bool.Parse(parameters["ScrambleCreationDate"]))) .Replace("~SCRAMBLEMODIFICATIONDATE~", YesOrNo(bool.Parse(parameters["ScrambleModificationDate"]))) .Replace("~SCRAMBLEACCESSDATE~", YesOrNo(bool.Parse(parameters["ScrambleAccessDate"]))) .Replace("~DELETEFOLDERS~", YesOrNo(bool.Parse(parameters["DeleteFolders"]))) .Replace("~OUTPUTLOGDIRECTORY~", parameters["OutputDirectory"] + "\\" + InvocationTimeStamp); string JobFileInstance = Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PhysicalFileDeletionNode\\DefensibleForensicDeletion" + InvocationTimeStamp + ".xml"; System.IO.File.WriteAllText(JobFileInstance, JobFileTemplate, Encoding.GetEncoding("UTF-8")); Dictionary <string, string> licenseInfo = GetNuixLicenseInfo(); string [] bat = new string [] { "@echo OFF", "echo RootCasesDirectory=" + parameters["RootCasesDirectory"], "echo OutputDirectory=" + parameters["OutputDirectory"], "echo CollectorExecutable=" + parameters["CollectorExecutable"], "echo Scope=" + parameters["Scope"], "echo VerificationOne=" + parameters["VerificationOne"], "echo Username="******"Username"], "echo Domain=" + parameters["Domain"], "echo Password(Encrypted)=" + System.Convert.ToBase64String(Encoding.ASCII.GetBytes(parameters["Password"])), "echo ScrambleCreationDate=" + parameters["ScrambleCreationDate"], "echo ScrambleAccessDate=" + parameters["ScrambleAccessDate"], "echo ScrambleModificationDate=" + parameters["ScrambleModificationDate"], "echo DeleteFolders=" + parameters["DeleteFolders"], "echo OverwriteCount=" + parameters["OverwriteCount"], "echo VerificationTwo=" + parameters["VerificationTwo"], "echo VerifyCreationDate=" + parameters["VerifyCreationDate"], "echo VerifySize=" + parameters["VerifySize"], "echo VerifyModificationDate=" + parameters["VerifyModificationDate"], "echo VerifyMD5Hash=" + parameters["VerifyMD5Hash"], "echo VerifyAccessDate=" + parameters["VerifyAccessDate"], "echo ValidateJobFileXML=" + parameters["ValidateJobFileXML"], "echo SendNotifications=" + parameters["SendNotifications"], "echo NotificationTargets=" + parameters["NotificationTargets"], "\"" + NuixCommandConsole.GetNuixWorkstationDirectory() + "\\jre\\bin\\java.exe\" -cp \"" + Directory.GetCurrentDirectory() + "\";.\\nuix-command-console.jar;\"" + NuixCommandConsole.GetNuixEngineDirectory() + "\\lib\\*\" com.nuix.cc.collector.PhysicalFileDeletion \"" + parameters["RootCasesDirectory"] + "\" \"" + parameters["OutputDirectory"] + "\" \"" + licenseInfo["licensesourcetype"] + "\" \"" + licenseInfo["licencesourcelocation"] + "\" \"" + licenseInfo["licencetype"] + "\" \"" + licenseInfo["nms.username"] + "\" \"" + licenseInfo["nms.password"] + "\" \"" + InvocationTimeStamp + "\" \"" + parameters["Scope"] + "\" \"" + parameters["CollectorExecutable"] + "\" \"" + JobFileInstance + "\" \" -Dnuix.registry.servers=\"" + NuixCommandConsole.getNuixManagementServerRegistryServers() + "\" -Djava.io.tmpdir=\"" + licenseInfo["java.io.tmpdir"] + "\" -Dnuix.logdir=\"" + licenseInfo["nuix.logdir"] + "\" -Dnuix.loglevel=\"" + licenseInfo["nuix.loglevel"] + "\"" }; System.IO.File.WriteAllLines(Directory.GetCurrentDirectory() + "\\ActivityTemplates\\PhysicalFileDeletionNode\\PhysicalFileDeletionNode.bat", bat); return(parameters); }