Skip to content

Instantly share code, notes, and snippets.

@bbrala
Last active October 17, 2024 08:37
Show Gist options
  • Save bbrala/1655e083487c4e87211e5ca00b77d4db to your computer and use it in GitHub Desktop.
Save bbrala/1655e083487c4e87211e5ca00b77d4db to your computer and use it in GitHub Desktop.
JAMF NOW - convert all apps to admin-managed (javascript)
async function updateLoop() {
const timer = ms => new Promise(res => setTimeout(res, ms));
document.querySelector('[data-test="device-nav-apps"]').click();
await timer(500);
let menuList = document.querySelectorAll('button.more-menu');
for (const menu of menuList) {
menu.click();
await timer(100);
let convertButton = document.querySelector('button[data-test="device-store-app-convert-to-jamf-now-managed"],button[data-test="device-store-app-convert"]');
// let convertButton = document.querySelector('button[data-test="device-store-app-convert-to-jamf-now-managed"]');
if (convertButton) {
let appName = menu.parentElement.parentElement.querySelector('div.name span').textContent;
console.log('Found button, coverting ' + appName + '...');
convertButton.click();
await timer(1000);
document.querySelector('.modal-footer [text="APP:CONVERT_MANAGED:SUBMIT"]').click();
await timer(1000);
}
menu.click();
await timer(100);
}
}
updateLoop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment