0

Today, as per client requirement,I made one of the site collections in our production environment on SP 2013 in read only mode. After doing so, we are getting

This site is read only at the farm administrator's request

banner at the top of the page.

Is there any PowerShell command to hide this banner from the page?

Thanks in advance!!!

  • Use Css to hide it? – Akhoy Jan 31 '16 at 14:25
0

There is a div with id="status_preview" right under the starting <body> tag.

Execute document.getElementById('status_preview'+'').style.display='none' to hide it (try it in devconsole of your browser).

There are a lot of ways to do it in SP, the fast & dirty one is to modify your masterpage to include lines like:

<SharePoint:ScriptBlock runat="server">
function rndmjsfnctnm127548247() 
{
   document.getElementById('status_preview'+'').style.display='none';
   return false; 
}
SP.SOD.executeOrDelayUntilScriptLoaded(somerandomjsfunctionname1231241, 'SP.js');
</SharePoint:ScriptBlock>

rndmjsfnctnm127548247 is completely random here - select you own

There is no powershell command nor other way to prevent that div from being inserted

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.