Created
July 21, 2025 17:33
-
-
Save CrookedJ/03f320bf390fac9b2791f101d2d2909a to your computer and use it in GitHub Desktop.
Remove Email Activity from SolarWinds Service Desk Audit Log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove emails from audit log | |
// @namespace http://tampermonkey.net/ | |
// @version 2025-05-13 | |
// @description remove the email related logs from the audit tab | |
// @author Josh Crook | |
// @match https://helpdesk.your-domain.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=samanage.com | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
let xpath; | |
let elements; | |
(function() { | |
'use strict'; | |
// Select the audit tab element | |
let tabElement = document.querySelector('li.audit > div'); | |
// Add an event listener for the click event | |
tabElement.addEventListener('click', function() { | |
// Wait for the content to load (adjust delay as needed) | |
setTimeout(function() { | |
// XPath query to match elements containing any of the specified text strings | |
xpath = "//div[contains(text(), 'commented email for') or contains(text(), 'changed email for') or contains(text(), 'created email for') or contains(text(), 'mentioned email for') or contains(text(), 'notification email') or contains(text(), 'resolved email for') or contains(text(), 'completed notification email for')]"; | |
elements = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
// Loop through the matched elements and apply styles or modifications | |
for (let i = 0; i < elements.snapshotLength; i++) { | |
let element = elements.snapshotItem(i); | |
// Traverse up to the grandparent element | |
let grandparentElement = element.parentElement.parentElement; | |
// Hide the grandparent element | |
if (grandparentElement) { | |
grandparentElement.style.display = 'none'; | |
} | |
} | |
}, 1000); // Delay in milliseconds (adjust based on content load time) | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment