Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

InactiveUsersLast90Days.ps1 - limit of 5000 audit log items #80

@joeljeffery

Description

@joeljeffery

This script only shows a list of users that have not logged in for 90 days or more if your tenancy happens to have fewer than 5000 matching audit log entries for the following actions over the last 90 days: UserLoggedIn, PasswordLogonInitialAuthUsingPassword, UserLoginFailed.

$loggedOnUsers = Search-UnifiedAuditLog -StartDate $startDate -EndDate $endDate -Operations UserLoggedIn, PasswordLogonInitialAuthUsingPassword, UserLoginFailed -ResultSize 5000

In any reasonably active tenancy, you're going to get mainly false positives.

You need to batch these requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions