Posted on:
Categories: SharePoint;PowerShell

After performing a content migration from a file share to SharePoint using a third party utility, we noticed that some folders had a modified date of December 29, 1900. This only affected folders, and there didn't appear to be any pattern determining which folders were affected.

I wrote the following script to set the modified date for all affected folders to the current date and time​

$date = Get-Date
$web = Get-SPWeb "SPWebURL"
foreach($list in $web.lists){
    foreach($folder in $list.folders){
        if($folder["Modified"].ToString() -like "*1900*"){
            $folder["Modified"] = $date