I have a question about a script I am writing. I need a script that can find all folders inside a specific folder (in this case WRA), but I also want to find the sub-folders inside WRA For example: \Server01\WRA contains 100 folders \Server01\WRA\Folder 1 \Server01\WRA\Folder 2 ... ...
I want to look inside the "Folder 1" and obtain a report of the folders inside "Folder 1" and locate the folders older than 30 days which can be done with
Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-30))}
This is what I have so far
$FolderNames = Get-ChildItem "\\Server01\WRA\" -Directory |
Select-Object Name, LastWriteTime
$FolderNames
Thank you for all your help