Find old files recursively with powershell script:
1 |
Get-ChildItem -path \\servername\fileshare\folder -Recurse -Force -File | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} |
Find the oldest file:
1 |
Get-ChildItem -path \\servername\share\folder -Recurse -Force -File | Sort-Object CreationTime | Select-Object -First 1 |