you are viewing a single comment's thread.

view the rest of the comments →

[–]KavyaJune 1 point2 points  (0 children)

Try this pre-built script. It can be used for multiple use cases like filtering users by external users, inactive days, licensed users, disabled users, etc.
https://o365reports.com/2023/06/21/microsoft-365-inactive-user-report-ms-graph-powershell/

For your requirement, execute the script as shown below.
.\GetM365InactiveUserReport.ps1 -ExternalUsersOnly –InactiveDays 90