{"id":1360,"date":"2014-02-23T12:15:57","date_gmt":"2014-02-23T12:15:57","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1360"},"modified":"2024-05-13T10:36:17","modified_gmt":"2024-05-13T10:36:17","slug":"fixing-checked-out-files","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/fixing-checked-out-files\/","title":{"rendered":"Fixing Checked Out Files"},"content":{"rendered":"<h2>Fixing Checked Out Files<\/h2>\n<p>I ran into a challenge this evening with a monstrously large library filled with 5,000+ folders with 47,000+ files.<\/p>\n<p>What to do?<\/p>\n<p>Firstly, things don\u2019t work correctly until the list view threshold is temporarily lifted. Once that is done, we can iterate through the files, take the checked out ones over, and force the check in.<\/p>\n<p>Here\u2019s how:<\/p>\n<pre lang=\"php\">$root = get-spweb \"ht tp:\/\/SharePoint\/sites\/site\"\r\n$lib = $root.lists[\"LibraryName\"]\r\n$x = $lib.CheckedOutFiles\r\n$count = $x.Count\r\nfor ($i=$count-1; $i -ge 0; $i--)\r\n{\r\n$Checkeditem = $x.get_Item($i)\r\n$Checkeditem.TakeOverCheckOut()\r\n \r\n$libitem = $lib.GetItemById($Checkeditem.listitemid)\r\n$libitem.File.CheckIn(\"\")\r\nWrite-Host -NoNewline \".\"\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fixing Checked Out Files I ran into a challenge this evening with a monstrously large library filled with 5,000+ folders with 47,000+ files. What to do? Firstly, things don\u2019t work correctly until the list view threshold is temporarily lifted. Once that is done, we can iterate through the files, take the checked out ones over, [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":1369,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1360"}],"version-history":[{"count":5,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1360\/revisions"}],"predecessor-version":[{"id":3945,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1360\/revisions\/3945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1369"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}