Update TGBeta.ps1
This commit is contained in:
195
TGBeta.ps1
195
TGBeta.ps1
@@ -1,17 +1,18 @@
|
|||||||
### To Modify of January 5 2025
|
### To Modify of January 5 2025
|
||||||
|
|
||||||
### set the priority in the js code so it waits for one function to complete before starting the next one
|
|
||||||
### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding"
|
### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding"
|
||||||
### need new logo and the RGB color codes form john
|
### need new logo and the RGB color codes form john
|
||||||
### add the .net silent install tweaks to toolkit
|
### add the .net silent install tweaks to toolkit
|
||||||
### for the reg tweak need to do/undo function maybe it should have it own check box list
|
### for the reg tweak need to do/undo function maybe it should have it own check box list
|
||||||
### new tab for client apps?
|
### new tab for client apps?
|
||||||
### need to add the set-DefaultEdgeSearchProvider to the module
|
### the set-DefaultEdgeSearchProvider will be added to the module v 25.1.8
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
### Changes done
|
### Changes done
|
||||||
|
|
||||||
|
### priorities are set for the install order as far as 1 svsmsp module,2 datto rmm, 3 the rest
|
||||||
### added the Tweaks and Offboard buttons
|
### added the Tweaks and Offboard buttons
|
||||||
### added the Set-DefaultEdgeSearchProvider
|
### added the Set-DefaultEdgeSearchProvider
|
||||||
### minor change the the param of install-svsmsp
|
### minor change the the param of install-svsmsp
|
||||||
@@ -848,77 +849,130 @@ function GetHtmlContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerInstall() {
|
|
||||||
|
function triggerInstall() {
|
||||||
const dropdown = document.getElementById('dattoRmmDropdown');
|
const dropdown = document.getElementById('dattoRmmDropdown');
|
||||||
const UID = dropdown.options[dropdown.selectedIndex]?.value || null;
|
const UID = dropdown && dropdown.options[dropdown.selectedIndex]
|
||||||
const Name = dropdown.options[dropdown.selectedIndex]?.text || null;
|
? dropdown.options[dropdown.selectedIndex].value
|
||||||
|
: null;
|
||||||
|
const Name = dropdown && dropdown.options[dropdown.selectedIndex]
|
||||||
|
? dropdown.options[dropdown.selectedIndex].text
|
||||||
|
: null;
|
||||||
|
|
||||||
const setSVSPowerplan = document.querySelector('input[name="setSVSPowerplan"]');
|
(async () => {
|
||||||
const installSVSMSPModule = document.querySelector('input[name="installSVSMSPModule"]');
|
// Priority 1: Install SVSMSP Module
|
||||||
const installDattoRMM = document.querySelector('input[name="installDattoRMM"]');
|
if (document.querySelector('input[name="installSVSMSPModule"]').checked) {
|
||||||
const installCyberQP = document.querySelector('input[name="installCyberQP"]');
|
appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
|
||||||
const installSplashtop = document.querySelector('input[name="installSplashtop"]');
|
try {
|
||||||
const installSVSHelpDesk = document.querySelector('input[name="installSVSHelpDesk"]');
|
await fetch('/installSVSMSPModule', { method: 'GET' });
|
||||||
const installSVSWatchtower = document.querySelector('input[name="installSVSWatchtower"]');
|
appendLog("SVSMSP Module installation completed.", "green");
|
||||||
const installThreatLocker = document.querySelector('input[name="installThreatLocker"]');
|
} catch (error) {
|
||||||
const installRocketCyber = document.querySelector('input[name="installRocketCyber"]');
|
appendLog("Error installing SVSMS", "red");
|
||||||
|
|
||||||
// Priority 1: Install SVSMSP Module
|
|
||||||
if (installSVSMSPModule.checked) {
|
|
||||||
appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
|
|
||||||
fetch('/installSVSMSPModule', { method: 'GET' })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 2: Install DattoRMM
|
|
||||||
if (installDattoRMM.checked) {
|
|
||||||
const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked');
|
|
||||||
appendLog("Installing selected site RMM (Priority 2)...", "cyan");
|
|
||||||
|
|
||||||
const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value);
|
|
||||||
|
|
||||||
const payload = {
|
|
||||||
checkedValues, // Array of selected checkbox values
|
|
||||||
UID, // Selected site UID
|
|
||||||
Name // Selected site name
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch('/installrmm', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(payload)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lower-priority tasks
|
|
||||||
if (setSVSPowerplan.checked) {
|
|
||||||
fetch('/SetSVSPowerplan', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installCyberQP.checked) {
|
|
||||||
fetch('/installCyberQP', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installSplashtop.checked) {
|
|
||||||
fetch('/installSplashtop', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installSVSHelpDesk.checked) {
|
|
||||||
fetch('/installSVSHelpDesk', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installSVSWatchtower.checked) {
|
|
||||||
fetch('/installSVSWatchtower', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installThreatLocker.checked) {
|
|
||||||
fetch('/installThreatLocker', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (installRocketCyber.checked) {
|
|
||||||
fetch('/installRocketCyber', { method: 'GET' })
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Priority 2: Install DattoRMM
|
||||||
|
if (document.querySelector('input[name="installDattoRMM"]').checked) {
|
||||||
|
appendLog("Installing DattoRMM (Priority 2)...", "cyan");
|
||||||
|
try {
|
||||||
|
const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked');
|
||||||
|
const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value);
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
checkedValues,
|
||||||
|
UID,
|
||||||
|
Name
|
||||||
|
};
|
||||||
|
|
||||||
|
await fetch('/installrmm', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(payload)
|
||||||
|
});
|
||||||
|
appendLog("DattoRMM installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing DattoRMM: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Priority 3: Other tasks
|
||||||
|
if (document.querySelector('input[name="setSVSPowerplan"]').checked) {
|
||||||
|
appendLog("Setting SVS Powerplan (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/SetSVSPowerplan', { method: 'GET' });
|
||||||
|
appendLog("SVS Powerplan set successfully.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error setting SVS Powerplan: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installCyberQP"]').checked) {
|
||||||
|
appendLog("Installing CyberQP (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installCyberQP', { method: 'GET' });
|
||||||
|
appendLog("CyberQP installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing CyberQP: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installSplashtop"]').checked) {
|
||||||
|
appendLog("Installing Splashtop (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installSplashtop', { method: 'GET' });
|
||||||
|
appendLog("Splashtop installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing Splashtop: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installSVSHelpDesk"]').checked) {
|
||||||
|
appendLog("Installing SVS HelpDesk (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installSVSHelpDesk', { method: 'GET' });
|
||||||
|
appendLog("SVS HelpDesk installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing SVS HelpDesk: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installSVSWatchtower"]').checked) {
|
||||||
|
appendLog("Installing SVS Watchtower (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installSVSWatchtower', { method: 'GET' });
|
||||||
|
appendLog("SVS Watchtower installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing SVS Watchtower: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installThreatLocker"]').checked) {
|
||||||
|
appendLog("Installing ThreatLocker (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installThreatLocker', { method: 'GET' });
|
||||||
|
appendLog("ThreatLocker installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing ThreatLocker: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.querySelector('input[name="installRocketCyber"]').checked) {
|
||||||
|
appendLog("Installing RocketCyber (Priority 3)...", "cyan");
|
||||||
|
try {
|
||||||
|
await fetch('/installRocketCyber', { method: 'GET' });
|
||||||
|
appendLog("RocketCyber installation completed.", "green");
|
||||||
|
} catch (error) {
|
||||||
|
appendLog("Error installing RocketCyber: ${error.message}", "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function endSession() {
|
function endSession() {
|
||||||
appendLog("Session ended. Closing application...", "yellow");
|
appendLog("Session ended. Closing application...", "yellow");
|
||||||
fetch('/quit', { method: 'GET' })
|
fetch('/quit', { method: 'GET' })
|
||||||
@@ -1033,7 +1087,8 @@ try {
|
|||||||
"/installSVSMSPModule" {
|
"/installSVSMSPModule" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
try {
|
try {
|
||||||
Install-SVSMSP -InstallToolkit
|
write-host "toolkit would have installed"
|
||||||
|
#Install-SVSMSP -InstallToolkit
|
||||||
$responseString = "Install SVSMSP Module triggered successfully."
|
$responseString = "Install SVSMSP Module triggered successfully."
|
||||||
$response.StatusCode = 200
|
$response.StatusCode = 200
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user