30-second answer

PowerShell
Get-PnPTenantSite -Identity https://contoso.sharepoint.com/sites/oldproject |
  Select-Object Url, LockState, ArchiveStatus

LockState is Unlock, ReadOnly or NoAccess. ArchiveStatus is NotArchived or an archival state from Microsoft 365 Archive.

What this proves

Whether the site is in a state where content changes are possible. A locked or archived site cannot be changed by its users, whatever their permissions say.

What it does not prove

  • Why it was locked or archived. The state records the decision, not the reason: legal hold, decommissioning, cost management and abandoned cleanup all look the same here.
  • That the content is gone. Archived and read-only content still exists, still appears where policies let it, and still has to be counted in migrations and audits.

PowerShell

PowerShell
Get-PnPTenantSite |
  Where-Object { $_.LockState -ne 'Unlock' -or $_.ArchiveStatus -ne 'NotArchived' } |
  Select-Object Url, LockState, ArchiveStatus

Example output

Text
Url                                            LockState ArchiveStatus
---                                            --------- -------------
https://contoso.sharepoint.com/sites/legacy    ReadOnly  NotArchived
https://contoso.sharepoint.com/sites/2019bid   Unlock    Archived

Explanation

These two properties change what every activity metric means. A site nobody has edited in two years reads as abandoned, unless it is read-only, in which case nobody could have edited it: the inactivity is the consequence of a decision, not a signal of neglect. Any staleness report that does not first exclude undecidable sites files deliberate archives next to genuine abandonment, and both readings suffer for it.

Production considerations

  • Both properties come from the tenant record; the admin-centre connection and a SharePoint administrator role are required.
  • NoAccess sites refuse even reads. Expect collection to fail on them, and record the refusal as its own fact rather than as an empty site.
  • SPO-ACTIVITY-001: applicability excludes sites nobody could change

References

Found something wrong? Suggest a correction. The article source is not public; the engine it cites is.

What this answer underwrites

The engine reads these Microsoft operations to collect evidence, so what is established here is what those collectors rest on.

  • activitywhen a person last changed something on one site
  • sharingwhat one site permits, and its default link
  • sitesevery site this identity can enumerate