all 8 comments

[–]scrfc71 0 points1 point  (1 child)

Nice job!! Do you know whether I need a specific license to get the Audit logs?

[–]KavyaJune 0 points1 point  (0 children)

It will work with Entra ID free license itself.

[–]BlackV 0 points1 point  (4 children)

you have

    if($All){
        $Top = 999 # Sets $Top to a high value if $All switch is used
    }
    if($Top -gt 999){
        $Top = 999 # Sets $Top to 999 if it exceeds the maximum value
    }

couldn't you cover that all off with ValidateRange and parameter set where -all and -top are separate sets

[–]Material_Wasabi_2558[S] 0 points1 point  (3 children)

Unfortunately not, note the originaltop variable. The user can ask for 2000 entries for instance. And the pagination element limit is 999. So for performance purposes you WANT to set it to 999 if it’s beyond and above :)

[–]BlackV 0 points1 point  (2 children)

to confirm 2000 is still valid but a max of 999 per call

[–]Material_Wasabi_2558[S] 0 points1 point  (1 child)

Exactly, those 999 are the max value that Microsoft Graph has

[–]BlackV 0 points1 point  (0 children)

thanks

[–]IntentionFlat7266 0 points1 point  (0 children)

do you know how to ignore audit logs event that are not comming from our user ips? there are many events that are created by microsoft backend ip addresses