Skip to content

Commit 80e8276

Browse files
authored
Document Report-InactiveGuestUsers-150Days.ps1 script
Added documentation for the Report-InactiveGuestUsers-150Days.ps1 script, detailing its functionality and usage.
1 parent ea9f747 commit 80e8276

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ PowerShell-Scripts/
3333
│ └── Inspect-AzWebAppSecurity-Consolidated.ps1
3434
│ └── Audit-NeverSucceedingMailForwardingRules.ps1
3535
│ └── Review-TeamsLifecycleCleanupCandidates.ps1
36+
│ └── Report-InactiveGuestUsers-150Days.ps1
3637
│ └── 👉** Azure AD application auditing tools **
3738
list_all_applications2.ps1
3839
BulkMultiPermExploitability2.ps1
@@ -361,6 +362,42 @@ Use like so:
361362
.\Review-TeamsLifecycleCleanupCandidates.ps1
362363
```
363364

365+
---
366+
### `Report-InactiveGuestUsers-150Days.ps1`
367+
368+
Creates a read-only report of Microsoft Entra guest users who have been inactive for more than a defined number of days.
369+
370+
By default, the script reports guest users inactive for more than **150 days** and exports the results to CSV, sorted from oldest sign-in to newest sign-in.
371+
372+
Will check Microsoft Entra guest users for things like:
373+
374+
- Guest account display name
375+
- Guest user principal name
376+
- Mail address
377+
- Account enabled/disabled state
378+
- External user state
379+
- Created date
380+
- Last successful sign-in date
381+
- Last interactive sign-in date
382+
- Last non-interactive sign-in date
383+
- Effective last sign-in date
384+
- Days since last sign-in
385+
- Inactivity reason
386+
- Recommended action
387+
- Object ID
388+
389+
Guests with no sign-in date are included as **Never signed in** if the guest account was created before the inactivity threshold.
390+
391+
This script is useful for reviewing stale B2B/guest accounts before disabling or removing access.
392+
393+
The script does **not** block, delete, or modify users.
394+
395+
Use like so:
396+
397+
```powershell
398+
.\Report-InactiveGuestUsers-150Days.ps1
399+
```
400+
364401
## ── 📂 Section: On-Prem Active Directory ──
365402
---
366403
### `ad_object_permissions3.ps1`

0 commit comments

Comments
 (0)