The organisation's SharePoint estate was at 98% utilisation. Storage was being consumed by excessive version history β default 500 major versions per file. With limited budgets, an internal solution was needed.
A custom PowerShell pipeline using Entra ID certificate authentication, Graph API queries, and batch version trimming. Two scripts working in tandem: one for setting limits and trimming, one for monitoring job progress.
| Script | Purpose | Auth |
|---|---|---|
| Combined.ps1 | Main orchestrator β CSV import, version limit prompt, batch set, batch trim, audit log | Cert + PnP |
| StorageCounter.ps1 | JWT assertion β Graph API β site size calculation | JWT + Graph |
| Working_Job_Status.ps1 | Full status dashboard β polls Master.csv, updates 15+ columns per site | SPO Admin |
| PrivateChannelInfoCheck.ps1 | Enumerates all Teams, channels, members via Graph API | Cert + Graph |
| OneDriveCheck.ps1 | Batch OneDrive site check with exponential backoff, 50-site batches | Graph + SPO |
| Provision_New_2.ps1 | OneDrive provisioning with full logging and 15-min wait | SPO Admin |
Navigate to Entra ID β App registrations β New registration. Enter a name, leave defaults, click Register. Note the Application (Client) ID and Tenant (Directory) ID.
For interactive PnP use, add SharePoint Delegated permissions such as AllSites.Read. For unattended certificate/app-only automation, use SharePoint Application permissions such as Sites.Read.All or Sites.FullControl.All, then grant admin consent. Choose the least privilege that covers the operation.
In PowerShell as Administrator:
Install both .cer and .pfx files on the machine (right-click β Install Certificate, accept defaults). Then upload the .cer file to Entra ID: App β Certificates & secrets β Upload certificate. Note the Thumbprint.
Use the collected IDs and certificate thumbprint in your scripts:
860KB. Full project lifecycle: introduction, objectives, challenges (deprecated cmdlets, silent auth changes, user permissions), solution overview, process pipeline, testing, deployment, outcome.
Project Doc2.7MB. Complete step-by-step guide with screenshots: app registration, API permissions, admin consent, cert generation, cert installation, authentication in PowerShell.
Technical Guide1.4MB. User-facing guide explaining version history, how it works, and what the changes mean for end users.
User Guide1.4MB. Technical reference for managing version history via PowerShell and SharePoint Online Management Shell.
Technical Ref90+ iterative CSV files from April 2-9, 2025. Each run tracked per-site progress: files processed, versions deleted, storage released, error counts.
MonitoringThree versions (v1, v4, Temp). Cross-referenced audit reports, stakeholder engagement across 100+ users, compliance admin access.
Project DocSQL + PTC Automation pipeline. Full SDLC: requirements gathering, SQL development, PTC integration, UAT, deployment, monitoring.
Project DocITIL-based runbook documenting 50+ PTC error types, actionable fixes, criticality levels, and response procedures.
Project DocEnd-point assessment project. Migrated software catalogue from Excel to Freshservice CMDB with relationship mapping.
EPA773KB CSV of users with cross-referenced access data. Method 2/3 scripts used this to identify unlicensed access.
Data1.3MB CSV mapping OneDrive site ownership, admin access, and license status for escalation.
DataData Science Certificate (Codecademy), Introduction to Cybersecurity (Cisco), BCS RITTech registration.
Cert