Powershell command to set the masterpage 'page layout' content type read-only to NO

Discussion Powershell command to set the masterpage 'page layout' content type read-only to NO

  • Wednesday, August 29, 2012 4:27 PM
     
     

    Hi Friends,

    Could anybody please let me know a powershell script for the changing the status of the 'page layout' content type read-only to NO in the masterpage gallery - library settings - advanced settings - page layout content in an out-of-the-box teamsite?


    Shonilchi..

All Replies

  • Wednesday, August 29, 2012 9:50 PM
     
     
    Can you please provide more information as to what you are trying to achieve?
  • Thursday, August 30, 2012 6:03 AM
     
     

    Hi Guru,

    I am setting this setting to no because when I try to enable the SharePoint Server Publish Infrastructure feature in the site collection features list, I am not able to enable because it gives out the message that this page layout content type setting should be set to no.


    Shonilchi..

  • Friday, August 31, 2012 7:14 PM
     
     

    Could you please Paste a copy of the error you are recieving?

    Did it correspond with an ULS log?  If so can you copy that here as well?


    pfcjt@hotmail.com

  • Monday, September 03, 2012 9:19 AM
     
     

    Hi,

    Here is the screenshot of the error that I get when I try to enable the SharePoint server Publishing infrastructure in the site collection features after a new teamsite is created.


    Shonilchi..

  • Friday, September 07, 2012 4:19 PM
     
     
    Any thoughts on this one anybody?

    Shonilchi..

  • Tuesday, November 13, 2012 12:55 PM
     
     

    Hi there Shonichi,

    I've seen this before; you could try setting the Read-Only state of the OOTB Document Content Type state to NO?

    Go to Site Content Types, then, go to the Document Content Types section
    Click Document in that section
    Click Advanced on the Site Content Types for that content type
    In the Read Only section of that page click YES
    Click OK

    Try switching on SharePoint Server Publish Infrastructure

    Hope this helps

    G

  • Wednesday, November 14, 2012 9:41 AM
     
     
    Thanks for the reply Geoff, but I do not want to deviate from my initial requirement which is a powershell script for the changing the status of the 'page layout' content type read-only to NO in the masterpage gallery - library settings - advanced settings - page layout content in an out-of-the-box teamsite.

    Shonilchi..

  • Wednesday, November 14, 2012 10:07 AM
     
      Has Code

    Try this:

    $w = get-web http://myweb $ct = $w.ContentTypes["Content Type Name"] $ct.ReadOnly = $false
    $ct.Update()



    Regards, Matthew
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

  • Wednesday, November 14, 2012 12:43 PM
     
     

    Hi Matthew,

    I tried the above code, but is not working.. so, these are the steps, i need in the script:

    1. Enabling the SharePoint Server Publishing Infrastructure feature at the top level.
    2. Trying to enable this will give out an error, saying that the content type "Page Layout" at "/sites/test/_catalogs/masterpage" is read only.
    3. Then, changing the status of the 'page layout' content type read-only to NO in the masterpage gallery - library settings - advanced settings - page layout content in an out-of-the-box teamsite.
    4. Then, enable the SharePoint Server Publishing Infrastructure feature which will be successful this time.

    Please note that the page layout content is not available until and unless this error pops up "Page Layout" at "/sites/test/_catalogs/masterpage" is read only."


    Shonilchi..

  • Monday, November 26, 2012 1:32 PM
     
     
    Hi, does anybody have a script for the above?

    Shonilchi..

  • Thursday, January 10, 2013 8:24 PM
     
      Has Code

    I don't have a script but would suggest you look open the top level site collection site in Sharepoint Designer.

    1. Click All files
    2. Expand the _catalogs folder
    3. Expand the masterpage folder

    Then ensure the following is complete on all the pages

    • masterpages are checked in
    • Masterpages are approved
    • That the appropiate permissions are applied

    Hopefully that works, If not

    Then using Matthew's script above and modifying a little bit

    $w = get-web http://myweb $list = $w.Lists["_catalogs/masterpage"] foreach ($item in $list)

    {$item.ReadOnly = $false
    $item.Update()}

    $w.Dispose()

    Hopefully that helps. 


    pfcjt@hotmail.com