SPClean

×

Get Free Access to SPClean

Enter your email to receive the installation guide and script download link.

SPClean

PowerShell Toolkit for SharePoint Permission Hygiene

Find orphaned users, score risk, generate reports, and remove safely — without enterprise-software pricing.

PowerShell PSGallery Downloads License

Why SPClean?

Every SharePoint tenant accumulates orphaned users — accounts that remain in site permission lists long after the employee left, the contractor finished, or the guest expired. Microsoft has no built-in tool to find and clean them at scale.

The result: deleted accounts still holding active permissions, compliance reports that flag ghost identities, and hours of manual cleanup per tenant.

SPClean fixes this in minutes.

What SPClean Does

🔍

Detect

Scans site User Information Lists and cross-checks with Entra ID to identify deleted, soft-deleted, disabled, and guest-orphaned accounts.

⚖️

Score Risk

Classifies each orphan as HIGH / MEDIUM / LOW based on account state and active permission assignments across your tenant.

📊

Report

Exports CSV, JSON, or self-contained HTML reports with sortable columns and colour-coded risk badges for compliance audits.

🛡️

Remove Safely

Removes users from UILs and revokes direct role assignments — with -WhatIf preview and JSON snapshot backups.

Restore

Accidental removal? SPClean can instantly re-apply permissions from a snapshot backup.

⏱️

Schedule

Registers a Windows Scheduled Task that runs unattended scans using secure App-Only authentication.

Designed for M365 Admins

Clean up your tenant with just a few lines of PowerShell.

# Connect to your tenant Connect-SPCTenant -TenantName 'contoso' -ClientId '<app-id>'# Scan all sites, export a colour-coded HTML report Get-SPCOrphanedUser -AllSites | Export-SPCReport -Format HTML -IncludeSummary# Preview what would be removed — no changes made Get-SPCOrphanedUser -AllSites | Remove-SPCOrphanedUser -WhatIf# Remove HIGH-risk orphans with a snapshot backup Get-SPCOrphanedUser -AllSites | Where-Object RiskLevel -eq 'HIGH' | Remove-SPCOrphanedUser -CreateSnapshot -SnapshotPath 'C:\Snapshots'

Ready to secure your tenant?

Start scanning your SharePoint sites in less than 5 minutes.

© 2026 M365 Automation. All rights reserved. Designed for M365 Admins.