Jump to content

Recommended Posts

Posted

Can anyone recommend any software that will show when files and folders were last accessed on a share? With a view to working out what may be able to be removed as it hasn’t been accessed in years.

Posted
10 minutes ago, Edu-IT said:

Can anyone recommend any software that will show when files and folders were last accessed on a share? With a view to working out what may be able to be removed as it hasn’t been accessed in years.

Jam Software Treesize can do this, I seem to remember there needed to be a specific setup to prevent the scan from changing the last accessed date. 

Posted

if you're a fan of PowerShell I have recently done a script for this which dumps out ALL file access times into a CSV Which can then be filtered. 

This is report only 

 

$Date = Get-Date -Format dd_MM_yyyy
Start-Transcript "C:\Scripts\filehistory\Files_$Date.txt"
$FileRoots = Get-ChildItem "D:\Common\Staff\" -Directory 
foreach ($fileroot in $FileRoots){
    $filerooters = Get-ChildItem "D:\Common\Staff\$fileroot" -Directory
    $Area = $Fileroot.Name
    new-item "C:\Scripts\filehistory\$Area\" -ItemType Directory -Force
    foreach($FileRot in $filerooters){
        $FolderName = $filerot.Name.Replace(" ","_")
        Write-Host $FolderName
        $Filelist = Get-ChildItem "D:\Common\Staff\$fileroot\$filerot" -Recurse 
        $OutputFile = "C:\Scripts\filehistory\$Area\File_History_$FolderName`_$Date_Size.csv"  
        Foreach ($Files in $Filelist){
            $LastAccess = $Files.LastAccessTime
            $LastModi = $Files.LastWriteTime 
            $Created = $Files.CreationTime
            $Path = $Files.Directory 
            $Name = $Files.Name
            $FullPath = $Files.FullName
            $Size = $Files.Length/1KB    
            [PSCustomObject] [ordered] @{
                FilePath     = $Path
                FileName         = $Name
                CreatedDate      = $Created
                LastMod   = $LastModi
                LastAccess = $LastAccess
                FullPath = $FullPath
                Size = $Size
            } | Export-Csv -Path $OutputFile -NoTypeInformation -Append -Force
        }
    }
}
Stop-Transcript

 

  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...