Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anyway to identify files which have not been accessed inside the last [insert time frame here] (for me its inside the last year) via a windows share?

I have access to the server and the files are only ever accessed via the windows share and never from the server itself.

The share has 70GB of data on it (NTFS). It has hundreds of thousands of files spread out within hundreds of folders. A mixture of MS Office related files, largish images, programs and more.

I'm primarily a programmer and am happy with a 'roll your own by doing this' answer... but I'd love there to be a mechanism in Windows (SBS Server 2003), an open source tool or a inexpensive commercial product.

Obviously I am keen that the tool helps me actually action this somehow. Having a list with which to manually work with the files is not the desired final outcome but is definitely a good start.

share|improve this question
I sometimes send notes out to people to clean up their disk space on shared storage. After adequate warning, I move them to another drive (As long as there's a backup) and then when people start questioning things, put those particular files back. Not feasible in most cases, but it seems to help for awhile get people to clean things up when necessary. – Bart Silverstrim Jun 23 '10 at 12:51
In your case, probably not feasible, but for smaller shares it's worked. :-) – Bart Silverstrim Jun 23 '10 at 12:51
up vote 3 down vote accepted


$Cutoffdate = (Get-date).AddDays(-365)
Get-Childitem –recurse \\server\share\folder | where-object {$_.LastAccessTime –gt $Cutoffdate}

And if you want to do something like move them:

$Cutoffdate = (Get-date).AddDays(-365)
$Destdirectory = '\\server\share\oldfiles'
Get-Childitem –recurse \\server\share\folder | where-object {$_.LastAccessTime –gt $Cutoffdate} | foreach {$_.MoveTo($Destdirectory)}

I should warn you that this isn't a perfect process. Windows doesn't keep track of Access Time very well, and you're likely to miss quite a few files that haven't actually been accessing in a long time, but someone has browsed the directory they're in (which sometimes updates the atime, other times not).

share|improve this answer
That worked but it appears that, like you stated, the files have been 'accessed' (I'm guessing virus scanner & thumbnail generation) even when they weren't being 'used'. :( but your solution appears to be very close to what I need, thank you. – InvertedAcceleration Jun 23 '10 at 13:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.