You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script has been refactored for clarity, consistency, and maintainability. All functions now accept a connection parameter and return standardized objects with DisplayName, UserPrincipalName, Mail, Reason, and Source, simplifying output and CSV exports. Array handling and search queries have been optimized for better performance, and inactive user detection has been restructured with a configurable inactivity threshold. Results from multiple sources are now consolidated into a single report, improving usability for governance audits. Additionally, security best practices have been applied for connection handling, and modular function design supports easier testing, future enhancements, and tenant-specific customization.
In order to keep your tenant clean (Governance), you might want to ensure that disabled or inactive user accounts will be replaced where oppropriate (Think Owners of sites/groups, assignedto user on tasks/planner and so on). This script will help you find those accounts.
7
+
Maintaining a clean and well-governed Microsoft 365 tenant requires visibility into disabled and inactive user accounts. These accounts can unintentionally retain ownership or assignments across SharePoint sites, Microsoft Teams, Microsoft 365 Groups, and task-based workloads such as Planner.
8
+
9
+
This script helps identify disabled and inactive user accounts from multiple sources, enabling administrators to proactively review and replace users where appropriate. By doing so, organizations can reduce operational risk, improve governance, and ensure continued accountability for owned resources and assigned workloads.
8
10
9
11

10
12
13
+
### Purpose
11
14
12
-
# [PnP PowerShell](#tab/pnpps)
15
+
The purpose of this script is to support Microsoft 365 governance by identifying user accounts that are disabled or inactive but may still hold ownership, permissions, or assignments across the tenant. The output can be used as an input for remediation activities such as ownership reassignment, access review, or account cleanup.
13
16
14
-
```powershell
17
+
### Use Cases
15
18
19
+
- Identifying disabled users who still own SharePoint sites or Microsoft Teams
20
+
- Detecting inactive users assigned to Planner tasks or project deliverables
21
+
- Supporting periodic access reviews and governance audits
22
+
- Preparing for offboarding or tenant cleanup initiatives
0 commit comments