• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Powershell Script to report on file usage

Hello, I need a powershell script to run against a mapped drive that will list large file, file not been accessed in over 12 months, and when the file was created please.

I am unable to install FSRM onto the server :(
0
infradatel
Asked:
infradatel
  • 2
1 Solution
 
infradatelAuthor Commented:
Oh and I need to include all folders and subfolders please.
0
 
XaelianCommented:
Hi mate,

Will list files that aren't modified in more than 12 months
$compareDate = (Get-Date).AddMonths(-12)
Get-ChildItem C:\Temp -Recurse | Where-Object { $_.LastWriteTime -lt $compareDate }

Open in new window


Will list the largest.
Get-ChildItem C:\Temp -Recurse | Sort-Object -Descending Length | Select -First 1

Open in new window


Show the creationdate
Get-ChildItem C:\Temp -Recurse | select Creationtime, Length, Name

Open in new window

0
 
chrismerrittCommented:
I would just export everything then you can filter in Excel much easier than running multiple PowerShell filters. PowerShell makes things easier at times, but also can make things take longer if you don't use it wisely :9
0
 
infradatelAuthor Commented:
Great thanks, sorry for the delay been away
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now