SharePoint 2013 Undocheckout page using PowerShell

InfoPath alternatives for form designing SharePoint

In this post we will discuss how we can do undo check out a page using PowerShell in SharePoint 2013. Recently we face one issue in one of the migration project. Some pages were coming check out by some people and when we try to do check-in, overwrite check-out or discard check out, nothing worked for us.

Also you can read:
– Generate URL using Calculated column in SharePoint 2013 List

– Office 365 Calendar Add-in by Virto Software Product Review

– The maximum number of web parts for all zones on this page has been exceeded error in SharePoint 2013

Below is the PowerShell script you can use to UndoCheckOut using PowerShell for SharePoint 2013. You can pass the particular page URL to do undocheckout.

Add-PSSnapin Microsoft.SharePoint.PowerShell

$spWeb = Get-SPWeb(“https://SiteURL/”)

$spFile = $spWeb.GetFile(“https://SiteURL/Pages/MyTestpage.aspx”)

$spFile.UndoCheckOut()

$spFile.CheckIn(“Checkin Done”[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)

$spFile.Update()

$spWeb.Dispose()

Hope this will be helpful.

Similar SharePoint 2013 Tutorials

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply