How to use Powershell to set Max template document size RRS feed

  • Question

  • I searched for following command

    The default size of site template in Sharepoint 2010 is 50MB. If you want to save site template that have more size you must increase the maximum size by command line using:

    stsadm -o setproperty -pn max-template-document-size -pv 20000000

    but this is for earlier version of SharePoint I want to use the alternate for this command in SharePoint 2010 PowerShell command. How do I do the same?


    Shamshad Ali
    Friday, January 21, 2011 10:55 AM


  • You have to update the MaxTemplateDocumentSize property on the SPWebService ContentService.

    In a SharePoint PowerShell window type"

    $docSize = 50000000
    $webservice = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    $webservice.MaxTemplateDocumentSize = $docSize

    You might need to call these if not in a "SharePoint" PowerShell window:

    According to this: 500MB is the max.

    Hope this helps!

    SharePoint 2010 MCM. Feel free to contact me
    Friday, January 21, 2011 12:06 PM