Friday, October 21, 2016

Check-in all files in list or library in SharePoint using Powershell

Powershell Script to Check-in all files/items in a specified list or library .

$spWeb = Get-SPWeb http://localhost    
$listName = "List/Library Name"    
 $list = $spWeb.Lists |? {$_.Title -eq $listName}    
  foreach ($item in $list.Items)     
    $itemFile = $item.File    
    if( $itemFile.CheckOutStatus -ne "None" )    
       $itemFile.CheckIn("Automatic CheckIn. (corp\SPInstallD)")    


1 comment:

  1. Its very useful to me. Wonderful blog.. Thanks for sharing informative Post.

    Installment loans
    Payday loans
    Title loans