-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added option to enable perUserMfaState #23
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Mark, ziet er echt top uit. Ik heb nog wel een paar kleine puntjes. Verder kan je misschien een kleine readme tikken en die in dit mapje plaatsen? Hier kan je de instructie en requirements (rechten) voor het gebruik van deze scripts noteren. Hier kan je dan ook een opmerking plaatsen voor het beta endpoint.
@@ -0,0 +1,322 @@ | |||
############################################### | |||
# Please not the scripting uses a beta endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the default headers and add this as comment. Also not -> note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gefixt
$WarningPreference = "Continue" | ||
|
||
#region functions | ||
function Convert-StringToBoolean($obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functie wordt niet gebruikt in scipt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is verwijderd
@@ -0,0 +1,322 @@ | |||
############################################### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the default headers and add this as comment. Also not -> note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default header toegevoegd
@@ -0,0 +1,10 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a header here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
$outputContext.AuditLogs.Add([PSCustomObject]@{ | ||
# Action = "" # Optional | ||
Message = "Skipped setting perUserMfaState to [$($state)] for account with AccountReference: $($actionContext.References.Account | ConvertTo-Json). Old value: [$($currentPerUserMfaState)]. New value: [$($state)]. Reason: No changes." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old value en new value lijkt me niet nodig als er geen changes zijn. Beter iets melden in de trend van
'Skipped setting perUserMfaState as state is already set to the desired state' of 'Skipped setting perUserMfaState as state is already set $state'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verwijderd
#region Verify account reference and required properties | ||
$actionMessage = "verifying account reference and required properties" | ||
if ([string]::IsNullOrEmpty($($actionContext.References.Account))) { | ||
throw "The account reference could not be found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dit lijkt me niet handig bij een revoke.
Bij grant en notfound: error
Bij revoke en notfound: geen error, maar skip van actie (en audit bericht met success op true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dit gaat om de account reference. Die zou altijd gevuld moeten tijn. Echter, in basis zouden we inderdaad ook moeten checken of de gebruiker nog bestaat. Dit zouden we in meerdere scripts moeten toevoegen. Dit gaat voor nu te ver
|
||
$outputContext.AuditLogs.Add([PSCustomObject]@{ | ||
# Action = "" # Optional | ||
Message = "$state perUserMfaState [$($actionContext.References.Permission.Name)] for account with AccountReference: $($actionContext.References.Account | ConvertTo-Json). Old value: [$($currentPerUserMfaState)]. New value: [$($state)]." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new state heb je al voorin de message staan. is het nodig om dit 2x in het audit bericht te plaatsen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aangepast
|
||
$outputContext.AuditLogs.Add([PSCustomObject]@{ | ||
# Action = "" # Optional | ||
Message = "Skipped setting perUserMfaState to [$($state)] for account with AccountReference: $($actionContext.References.Account | ConvertTo-Json). Old value: [$($currentPerUserMfaState)]. New value: [$($state)]. Reason: No changes." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old value en new value lijkt me niet nodig als er geen changes zijn. Beter iets melden in de trend van
'Skipped setting perUserMfaState as state is already set to the desired state' of 'Skipped setting perUserMfaState as state is already set $state'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aangepast
$warningMessage = "Error at Line [$($ex.InvocationInfo.ScriptLineNumber)]: $($ex.InvocationInfo.Line). Error: $($ex.Exception.Message)" | ||
} | ||
|
||
Write-Warning $warningMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarschijnlijk even uitbreiden met 'Unable to set $state for person X. Error message: '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lijkt me overbodig, dit blijkt al uit de actie
$warningMessage = "Error at Line [$($ex.InvocationInfo.ScriptLineNumber)]: $($ex.InvocationInfo.Line). Error: $($ex.Exception.Message)" | ||
} | ||
|
||
Write-Warning $warningMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarschijnlijk even uitbreiden met 'Unable to set $state for person X. Error message: '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lijkt me overbodig, dit blijkt al uit de actie
$WarningPreference = "Continue" | ||
|
||
#region functions | ||
function Convert-StringToBoolean($obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functie wordt niet gebruikt in scipt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verwijderd
No description provided.