30-second answer
$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
CustomMasterUrlbeing 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
$web = Get-PnPWeb -Includes MasterUrl, CustomMasterUrl
[pscustomobject]@{
MasterFile = Split-Path -Leaf $web.MasterUrl
CustomMasterFile = Split-Path -Leaf $web.CustomMasterUrl
}Example output
MasterFile CustomMasterFile
---------- ----------------
seattle.master seattle.masterExplanation
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.masternoroslo.masteris the real signal of classic branding effort, and classic branding is the part of a migration nobody can automate.
Related governance rules
SPO-MODERN-003: the site uses a master page other than the ones SharePoint provides
References
- Classic publishing sites and the modern experience (Microsoft Learn)
- Get-PnPWeb (PnP PowerShell)
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 siteagentsthe Copilot agents in one site, and the sources each declaresclassificationwhat a site records about the kind of content it holdsmodernityhow one site is built: template, branding, publishingownerswho administers one sitesharingwhat one site permits, and its default link