Skip to content

Instantly share code, notes, and snippets.

@EastArctica
Created January 1, 2025 19:53
Show Gist options
  • Save EastArctica/c81b8e94186f6ca4b3423bb4ec838ec7 to your computer and use it in GitHub Desktop.
Save EastArctica/c81b8e94186f6ca4b3423bb4ec838ec7 to your computer and use it in GitHub Desktop.
Microsoft Purview audit export
// Exports super basic information from a Microsoft Purview audit
// I made this because the "Export" button was taking too long
// Obviously this only works for the current page you're on
// Change as you see fit
let str = '';
document.querySelectorAll('div[data-automationid="DetailsRowFields"]').forEach(x => {
let time = x.querySelector('[data-automation-key="creationDate"]').innerText;
let ip = x.querySelector('[data-automation-key="IPAddress"]').innerText;
let user = x.querySelector('[data-automation-key="User"]').innerText;
let item = x.querySelector('[data-automation-key="Item"]').innerText;
str += `${time}\tby ${user}:\t'${item}'\n`
})
console.log(str);
copy(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment