导航

【HOW】用PowerShell更改最大模板文档大小

Posted on 2013-07-08 19:49  FryFish  阅读(236)  评论(0)    收藏  举报

在SharePoint Management Shell窗口键入:

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

如果直接打开了PowerShell窗体,则需要先加载如下模块:

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")

根据如下文章,模板文档最大允许500M:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebservice.maxtemplatedocumentsize(v=office.12).aspx

 
【附】用stsadm修改的命令如下:

cd "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"
stsadm -o setproperty -pn max-template-document-size -pv 524288000

 
参见:http://social.msdn.microsoft.com/Forums/sharepoint/en-US/caece761-3f28-4955-8137-85fd0182e2ef/how-to-use-powershell-to-set-max-template-document-size