I'm trying to find files not modified in the last 60 days on a Windows 2012 R2 server. The built-in search ability in Windows doesn't offer this ability and I have installed the Windows Search Service as a feature but nothing useful. Thanks in advance for your tips.
- 5What have you tried? We're not here to do your work for you. And honestly, just pasting your question title in to Google will probably give you exactly what you need.longneck– longneck2016-07-14 19:03:43 +00:00Commented Jul 14, 2016 at 19:03
- yep, I tried thatestudiante23– estudiante232016-07-14 23:06:06 +00:00Commented Jul 14, 2016 at 23:06
Add a comment |
2 Answers
You want the LastWriteTime property.
You could see my somewhat recent answer here using this property to basically write your script. Based on modifying that (but not testing it), something like:
$searchroot="[root path you're searching in]" $age=(get-date).AddDays(-60) Get-ChildItem $searchroot | where-object {$_.LastWriteTime -ge $age } | ForEach-Object { #Do something. Print it, store it in a variable, whatever you want to do with these files once you've found them. }
I figured it out. You type in "modified:5/15/2016 .. 7/14/2016" in the second field of the search dialog window. It's the field where you would type the file name. This will output all files that have been modified in the last 60 days. Thanks.