{"id":2521,"date":"2021-03-09T21:45:44","date_gmt":"2021-03-10T05:45:44","guid":{"rendered":"https:\/\/systemsolver.com\/StatlerBlog\/?p=2521"},"modified":"2021-03-09T21:45:44","modified_gmt":"2021-03-10T05:45:44","slug":"onedrive-repair-reset","status":"publish","type":"post","link":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/2021\/03\/09\/onedrive-repair-reset\/","title":{"rendered":"OneDrive repair reset and powershell get sharepoint recycle list and export user recycle bin to csv"},"content":{"rendered":"<h2>Reset onedrive on a computer<\/h2>\n<p>Run<\/p>\n<p>&nbsp;<\/p>\n<pre>%localappdata%\\Microsoft\\OneDrive\\onedrive.exe \/reset<\/pre>\n<p>wait<\/p>\n<p>run<\/p>\n<p>%localappdata%\\Microsoft\\OneDrive\\onedrive.exe<\/p>\n<h3>powershell get sharepoint recycle list<\/h3>\n<pre>(Get-SPSite -Identity \"[your site collection URL]\").RecycleBin | Export-CSV -Path \"[file path and name]\"<\/pre>\n<h3>export user recycle bin to csv<\/h3>\n<p><a href=\"https:\/\/social.technet.microsoft.com\/Forums\/en-US\/437381fc-e7e7-4bfa-9488-a23cbcfe825a\/get-the-recycle-bin-items-which-has-been-deleted-for-past-10-days-and-has-to-be-exported-to-excel?forum=sharepointgeneralprevious\">https:\/\/social.technet.microsoft.com\/Forums\/en-US\/437381fc-e7e7-4bfa-9488-a23cbcfe825a\/get-the-recycle-bin-items-which-has-been-deleted-for-past-10-days-and-has-to-be-exported-to-excel?forum=sharepointgeneralprevious<\/a><\/p>\n<pre class=\"prettyprint prettyprinted\" style=\"padding-left: 40px;\"><span class=\"pln\">$url<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span><span class=\"str\" data-blkn-colour=\"rgba(0,136,0,1)\">\"http:\/\/sp\"<\/span><span class=\"pln\">\n\n$deleteFrom <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span> <span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"lit\" data-blkn-colour=\"rgba(0,102,102,1)\">10<\/span><span class=\"pln\">\n\n$report <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span> <span class=\"str\" data-blkn-colour=\"rgba(0,136,0,1)\">\"$($dir)\\DeletedRecycleBinItems.csv\"<\/span>\n\n<span class=\"typ\">New<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Item<\/span><span class=\"pln\"> $report <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"pln\">type file <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Force<\/span> <span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">|<\/span> <span class=\"typ\">Out<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Null<\/span>\n\n<span class=\"typ\">Add<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Content<\/span><span class=\"pln\"> $report <\/span><span class=\"str\" data-blkn-colour=\"rgba(0,136,0,1)\">\"Name, Title, Deleted by, Deleted date, Path, File Guid\"<\/span><span class=\"pln\">\n\n$dateNow <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span> <span class=\"typ\">Get<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Date<\/span><span class=\"pln\">\n\n$dateDiff <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span><span class=\"pln\"> $dateNow<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">.<\/span><span class=\"typ\">AddDays<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">(<\/span><span class=\"pln\">$deleteFrom<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">)<\/span><span class=\"pln\">\n\n$site <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">=<\/span> <span class=\"typ\">Get<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">SPsite<\/span><span class=\"pln\"> $url\n\n$site<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">.<\/span><span class=\"typ\">Recyclebin<\/span> <span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">|<\/span> <span class=\"kwd\">where<\/span> <span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">{<\/span><span class=\"pln\"> $_<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">.<\/span><span class=\"pln\">deleteddate <\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"pln\">ge $dateDiff<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">}<\/span> <span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">|<\/span> <span class=\"kwd\">foreach<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">{<\/span> <span class=\"typ\">Add<\/span><span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">-<\/span><span class=\"typ\">Content<\/span><span class=\"pln\"> $report <\/span><span class=\"str\" data-blkn-colour=\"rgba(0,136,0,1)\">\"$($_.LeafName),$($_.Title),$($_.deletedbyname),$($_.deleteddate),$($_.Dirname),$($_.Id)\"<\/span>\n\n<span class=\"pun\" data-blkn-colour=\"rgba(102,102,0,1)\">}<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Reset onedrive on a computer Run &nbsp; %localappdata%\\Microsoft\\OneDrive\\onedrive.exe \/reset wait run %localappdata%\\Microsoft\\OneDrive\\onedrive.exe powershell get sharepoint recycle list (Get-SPSite -Identity &#8220;[your site collection URL]&#8221;).RecycleBin | Export-CSV -Path &#8220;[file path and name]&#8221; export user recycle bin to csv https:\/\/social.technet.microsoft.com\/Forums\/en-US\/437381fc-e7e7-4bfa-9488-a23cbcfe825a\/get-the-recycle-bin-items-which-has-been-deleted-for-past-10-days-and-has-to-be-exported-to-excel?forum=sharepointgeneralprevious $url=&#8221;http:\/\/sp&#8221; $deleteFrom = -10 $report = &#8220;$($dir)\\DeletedRecycleBinItems.csv&#8221; New-Item $report -type file -Force | Out-Null Add-Content $report &#8220;Name, Title, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2521","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/2521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/comments?post=2521"}],"version-history":[{"count":0,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/posts\/2521\/revisions"}],"wp:attachment":[{"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/media?parent=2521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/categories?post=2521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systemsolver.goodhealthyday.com\/StatlerBlog\/wp-json\/wp\/v2\/tags?post=2521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}