I got following error when I tried to Checkin files wich are Checked out by other users using powershell.
Exception calling "CheckIn" with "2" argument(s): "You cannot checkin and overwrite a published file." At C:\Users\administrator\Desktop\Test2.ps1:71 char:13 + $ListItems[$i].File.CheckIn("Checkin automatically",[Microsoft.Share ...
This is Powershell code:
if($ListItems[$i].File.CheckOutStatus -ne "None")
{
$ListItems[$i].File.CheckIn("Checkin automatically",[Microsoft.SharePoint.SPCheckinType]::OverwriteCheckIn)
}
How I checkin files forcefully that are checked out by other users for a long time using powershell?