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 one of Microsoft 365 Archive's states, which SharePoint Online PowerShell names RecentlyArchived for the seven days after a site is archived, then FullyArchived, and Reactivating on the way back.

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.
  • That no file is archived. Site-level and file-level archive states are independent, and file-level archiving is on by default once Microsoft 365 Archive is enabled: a site reading NotArchived can still hold archived files. ArchivedFileDiskUsed on Get-SPOSite gives the storage they use.

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    FullyArchived

Illustrative: the archive values are SharePoint Online's own, as listed above.

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