如何在一個Library下批量Check in Documents

WikiAddress: http://social.technet.microsoft.com/wiki/contents/articles/34377.sharepoint-2013-powershell-how-to-check-in-the-multiple-documents-in-the-sp-library.aspx

博客地址:http://blog.csdn.net/shelleyliu0415 

 

前段時間給大家回覆問題的時候,遇到一個需求:如何在開啓“Require Check Out”設置的Library下批量check in文件。

 

問題描述:由於Library開啓了“RequireCheck Out”設置,導致很多Documents在同步到Library時,自動被Check Out,因爲documents存儲在不同的folder下,希望一次性把這些documents變爲check in

 

解決方案: PowerShellcmdletdocuments進行批量check in,具體步驟如下:

 

$WebURL="http://cpshelley:9001/sites/Project_Shelley"

$LibraryName="shelley"  

 


 

$Web = Get-SPWeb $WebURL

$CheckedOu$DocLib =$Web.Lists.TryGetList($LibraryName)

 


 

$CheckedOutFiles = $DocLib.Items | Where-Object {$_.File.CheckOutStatus -ne "None"}

 


 

ForEach($item in $CheckedOutFiles) {$DocLib.GetItemById($item.Id).file.CheckIn("Checked in bycp01\administrator") }

 


 

 

謝謝閱讀!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章