The process of building custom solutions for SharePoint Server.
you need to load Site.ReadOnly property of appropriate site collection. You may do this by using helper PowerShell method Load-CSOMProperties of Garry Lapointe:
Load-CSOMProperties -object $site -propertyNames @("ReadOnly")
Here is example of usage of this method: PowerShell script for listing master pages in all sites of Sharepoint Online site collection via CSOM.