You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Graph.EasyPIM/Graph.EasyPIM.psm1
+38-6Lines changed: 38 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -61,10 +61,10 @@ function Enable-PIMRole {
61
61
.DESCRIPTION
62
62
Enable Entra ID PIM roles via an easy to use TUI (Text User Interface). Only supports enabling; not disabling. Use Disable-PIMRole to disable.
63
63
64
-
If a role needs a reason/ justification you can either enter one, or press enter to go with a default "need for work", or type something and end with * to use it for all the activations.
64
+
If a role needs a reason/ justification you can either enter one, or press enter to go with a default, or type something and end with * to use it for all the activations.
65
65
66
66
.PARAMETERSkipJustification
67
-
Optional. If specified, it sets the reason/ justifaction for activation to be a default "need for work".
67
+
Optional. If specified, it sets the reason/ justifaction for activation to be a default.
68
68
69
69
.PARAMETERJustification
70
70
Optional. If specified, it sets the reason/ justifaction for activation to whatever is input.
$defaultJustification="Activated using Graph.EasyPIM"
274
+
275
+
if ($env:USERDOMAIN) {
276
+
$userDomain="$($env:USERDOMAIN)\"
277
+
}
278
+
279
+
if ($env:USER) {
280
+
$defaultJustification=$defaultJustification+" by ${userDomain}$($env:USER)"
281
+
} elseif ($env:LOGNAME) {
282
+
$defaultJustification=$defaultJustification+" by ${userDomain}$($env:LOGNAME)"
283
+
} elseif ($env:USERNAME) {
284
+
$defaultJustification=$defaultJustification+" by ${userDomain}$($env:USERNAME)"
285
+
}
286
+
287
+
if ($env:ComputerName) {
288
+
$defaultJustification=$defaultJustification+" on $($env:ComputerName)"
289
+
}
274
290
275
291
# I use these for showing progress
276
292
[int]$counter=0
@@ -1019,10 +1035,10 @@ function Enable-PIMGroup {
1019
1035
.DESCRIPTION
1020
1036
Enable Entra ID PIM groups via an easy to use TUI (Text User Interface). Only supports enabling; not disabling. Use Disable-PIMGroup to disable.
1021
1037
1022
-
If a group needs a reason/ justification you can either enter one, or press enter to go with a default "need for work", or type something and end with * to use it for all the activations.
1038
+
If a group needs a reason/ justification you can either enter one, or press enter to go with a default, or type something and end with * to use it for all the activations.
1023
1039
1024
1040
.PARAMETERSkipJustification
1025
-
Optional. If specified, it sets the reason/ justifaction for activation to be a default "need for work".
1041
+
Optional. If specified, it sets the reason/ justifaction for activation to be a default.
1026
1042
1027
1043
.PARAMETERJustification
1028
1044
Optional. If specified, it sets the reason/ justifaction for activation to whatever is input.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Tested on Windows, macOS, and Linux with PowerShell 7.4. It currently has the fo
21
21
- Faster than Entra ID portal in my opinion. There is an initial delay as it pulls all the info, but after that it's pretty fast.
22
22
- It always activates the role or group for the maximum allowed duration.
23
23
- When selecting roles or groups, if the role or group is already active (and it's been active for more than 5 mins) it will deactivate and activate the role or group. Very useful when you can see a role or group activation is going to expire soon!
24
-
- You can skip offering a reason, either via the `-SkipJustification` switch or pressing `ENTER` when asked for one. This will set the reason as "need for work".
24
+
- You can skip offering a reason, either via the `-SkipJustification` switch or pressing `ENTER` when asked for one. This will set the reason as `Activated using Graph.EasyPIM by $env:USER on $env:COMPUTERNAME`.
25
25
- You can provide a justification before hand via the `-Justification` switch, or by entering one when prompted and adding an asterisk `*` at the end. This will set the same justification for all other roles or groups enabled in that round.
26
26
- The [Norton Commander](https://en.wikipedia.org/wiki/Norton_Commander)-ish TUI is a nice trip down memory lane. 🙂
0 commit comments