30-second answer

PowerShell
$web = Get-PnPWeb -Includes MasterUrl, CustomMasterUrl
$file = Split-Path -Leaf $web.MasterUrl
$file -notin @('seattle.master', 'oslo.master')

Compare the file name, never the full path.

What this proves

Which master page file the site is configured to use, and whether it is one of the two SharePoint provides.

What it does not prove

  • That custom branding is in effect. Modern pages do not use the master page; a classic-era custom master can sit configured on a site whose users only ever see modern pages.
  • That CustomMasterUrl being set means anything by itself. It is set on every site, out of the box, pointing at the default. Its presence is not a customisation signal.

PowerShell

PowerShell
$web = Get-PnPWeb -Includes MasterUrl, CustomMasterUrl
[pscustomobject]@{
    MasterFile       = Split-Path -Leaf $web.MasterUrl
    CustomMasterFile = Split-Path -Leaf $web.CustomMasterUrl
}

Example output

Text
MasterFile     CustomMasterFile
----------     ----------------
seattle.master seattle.master

Explanation

Two traps, both found on a real tenant. First, CustomMasterUrl is populated everywhere: a check for "is it set" fires on every site in the tenant. Second, the path carries the site: the root site reads /_catalogs/masterpage/seattle.master and /sites/finance reads /sites/finance/_catalogs/masterpage/seattle.master for the same default page. A rule comparing full paths against a known default reports every site that is not the root, which is most of them. The file name is the only part of the value that answers the question.

Production considerations

  • Load both properties with -Includes; unloaded CSOM properties return null, which reads as "no master page" if unguarded.
  • A file named neither seattle.master nor oslo.master is the real signal of classic branding effort, and classic branding is the part of a migration nobody can automate.
  • SPO-MODERN-003: the site uses a master page other than the ones SharePoint provides

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
  • agentsthe Copilot agents in one site, and the sources each declares
  • classificationwhat a site records about the kind of content it holds
  • modernityhow one site is built: template, branding, publishing
  • ownerswho administers one site
  • sharingwhat one site permits, and its default link