Skip to content

Commit 19799ec

Browse files
committed
README update + slight change to module
1 parent 38f9640 commit 19799ec

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

Graph.EasyPIM/Graph.EasyPIM.psd1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'Graph.EasyPIM.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.0.12'
15+
ModuleVersion = '0.0.13'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -118,7 +118,7 @@
118118
# IconUri = ''
119119

120120
# ReleaseNotes of this module
121-
ReleaseNotes = 'Minor changes.'
121+
ReleaseNotes = 'Changed the default justification. No other changes.'
122122

123123
# Prerelease string of this module
124124
# Prerelease = ''
@@ -138,6 +138,4 @@
138138

139139
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
140140
# DefaultCommandPrefix = ''
141-
}
142-
143-
141+
}

Graph.EasyPIM/Graph.EasyPIM.psm1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ function Enable-PIMRole {
6161
.DESCRIPTION
6262
Enable Entra ID PIM roles via an easy to use TUI (Text User Interface). Only supports enabling; not disabling. Use Disable-PIMRole to disable.
6363
64-
If a role needs a reason/ justification you can either enter one, or press enter to go with a randomly generated 12 character string, 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 "need for work", or type something and end with * to use it for all the activations.
6565
6666
.PARAMETER SkipJustification
67-
Optional. If specified, it sets the reason/ justifaction for activation to be a randomly generated 12 character string.
67+
Optional. If specified, it sets the reason/ justifaction for activation to be a default "need for work".
6868
6969
.PARAMETER Justification
7070
Optional. If specified, it sets the reason/ justifaction for activation to whatever is input.
@@ -269,7 +269,8 @@ function Enable-PIMRole {
269269
$roleDefinitionsCache = @{}
270270

271271
# Random 12 lower case characters
272-
$defaultJustification = -join ((97..122) | Get-Random -Count 12 | ForEach-Object {[char]$_})
272+
# $defaultJustification = -join ((97..122) | Get-Random -Count 12 | ForEach-Object {[char]$_})
273+
$defaultJustification = "need for work"
273274

274275
# I use these for showing progress
275276
[int]$counter = 0
@@ -1018,10 +1019,10 @@ function Enable-PIMGroup {
10181019
.DESCRIPTION
10191020
Enable Entra ID PIM groups via an easy to use TUI (Text User Interface). Only supports enabling; not disabling. Use Disable-PIMGroup to disable.
10201021
1021-
If a group needs a reason/ justification you can either enter one, or press enter to go with a randomly generated 12 character string, or type something and end with * to use it for all the activations.
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.
10221023
10231024
.PARAMETER SkipJustification
1024-
Optional. If specified, it sets the reason/ justifaction for activation to be a randomly generated 12 character string".
1025+
Optional. If specified, it sets the reason/ justifaction for activation to be a default "need for work".
10251026
10261027
.PARAMETER Justification
10271028
Optional. If specified, it sets the reason/ justifaction for activation to whatever is input.
@@ -1205,7 +1206,8 @@ function Enable-PIMGroup {
12051206
Write-Host ""
12061207

12071208
# Random 12 lower case characters
1208-
$defaultJustification = -join ((97..122) | Get-Random -Count 12 | ForEach-Object {[char]$_})
1209+
# $defaultJustification = -join ((97..122) | Get-Random -Count 12 | ForEach-Object {[char]$_})
1210+
$defaultJustification = "need for work"
12091211

12101212
# I use these for showing progress
12111213
[int]$counter = 0

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ Tested on Windows, macOS, and Linux with PowerShell 7.4. It currently has the fo
2121
- 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.
2222
- It always activates the role or group for the maximum allowed duration.
2323
- 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 generate a random 12 character string.
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".
2525
- 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.
2626
- The [Norton Commander](https://en.wikipedia.org/wiki/Norton_Commander)-ish TUI is a nice trip down memory lane. 🙂
2727

28+
## Good to know
29+
- The first time you run one of these cmdlets it will open up a browser window to authenticate. But if you are already connected to Graph, this might not happen and the cmdlets may not work. Do a `Disconnect-MgGraph` and then try the cmdlets again.
30+
- The list of eligible PIM roles are cached for 30 mins. The list of eligible PIM groups are cached for 8 hours. The cmdlets can be run with the `-RefreshEligibleGroup` to force a refresh.
31+
- You might need to involve a Global Admin to do some consents on the `Microsoft Graph Command Line Tools` service principal. To do an admin consent on behalf of the organization, a Global Admin is required; but an Application Admin can do consent for themselves. This URL should help (replace `{tenantId}`): `https://login.microsoftonline.com/{tenantId}}/v2.0/adminconsent?client_id=14d82eec-204b-4c2f-b7e8-296a70dab67e&scope=RoleEligibilitySchedule.Read.Directory RoleEligibilitySchedule.ReadWrite.Directory RoleManagement.Read.Directory RoleManagement.Read.All RoleManagement.ReadWrite.Directory RoleAssignmentSchedule.ReadWrite.Directory RoleAssignmentSchedule.Remove.Directory PrivilegedEligibilitySchedule.Read.AzureADGroup PrivilegedEligibilitySchedule.ReadWrite.AzureADGroup PrivilegedAccess.Read.AzureADGroup PrivilegedAccess.ReadWrite.AzureADGroup RoleManagementPolicy.Read.AzureADGroup`
32+
2833
## Pre-requisite modules
2934
This modules depends upon the following.
3035

@@ -61,4 +66,4 @@ Way faster than the Entra ID portal. And you can select more than 1 role at a go
6166

6267
## API reference
6368
- [PIM for Entra roles](https://learn.microsoft.com/en-us/graph/api/resources/privilegedidentitymanagementv3-overview?view=graph-rest-1.0)
64-
- [PIM for Groups](https://learn.microsoft.com/en-us/graph/api/resources/privilegedidentitymanagement-for-groups-api-overview?view=graph-rest-1.0).
69+
- [PIM for Groups](https://learn.microsoft.com/en-us/graph/api/resources/privilegedidentitymanagement-for-groups-api-overview?view=graph-rest-1.0)

0 commit comments

Comments
 (0)