Skip to content

Commit

Permalink
Added PIM hotkey script
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Feb 24, 2025
1 parent fc7b0f2 commit 4ddb002
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions m365-admin.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ==UserScript==
// @name M365 Admin - PIM Activate Hotkey
// @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic
// @version 1.0.0
// @description `Ctrl` + `Enter` to Activate PIM role instead of having to manually click the `Activate` button.
// @author Øyvind Nilsen (on@ntnu.no)
// @match https://portal.azure.com/?feature.msaljs=true#view/Microsoft_Azure_PIMCommon/ActivationMenuBlade/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com
// @grant none
// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js
// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js
// ==/UserScript==

(function() {
'use strict';

document.addEventListener('keydown', function(e) {
if (e.ctrlKey && e.key === 'Enter') {
var button_container = document.querySelector('div[data-formelement="pcControl: saveButton"]');
if (button_container) {
button_container.childNodes[0].click();
}
}
});
})();

0 comments on commit 4ddb002

Please sign in to comment.