I am using Office 365 SharePoint and have a requirement to require check in for all documents. As a result of this, whenever someone uploads a document, it is automatically checked out. Sometimes, the documents are never checked in. I want to write a script (through Powershell or CSOM - C#) that will check in files that have never been checked in.
I can manually do this by going to Library settings -> manage files with no checked in version, but I have a lot of document libraries and files. I have even encountered libraries that have over 5000 items that have never been checked in. There has to be a way to do this through code.