Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell script to find and list directories by modified date 1

Status
Not open for further replies.

ccoyle

MIS
Jan 30, 2003
17
US
Hi!

I have a ton of directories and subdirectories under a network share (H:). I need to identify any directory not modified since a certain date (10/1/2009) and list them in a file - .csv would be swell but obviously .txt would be fine too.

I've been tryting to get this done via vbs but just can't seem to get the syntax correct. I can post the vbs here too if desired but this wouldn't be the correct forum for that (so I didn't).

Thanks for any assistance!

-Chris
 
something like
Code:
getchilditems [directory] -r | where{$_.IsDirectory} | where {$_.LastWriteTime < [date]} | select {$_.fullname} | output-csv [filename]
this is off the top of my head, and my ps1 skills are novice, but it should get you started. the basic flow is
1. get all items under a directory recursively
2. only select directories
3. only select directories that have not been modified since a specific date
4. get full directory path
5. save to a csv file

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Thanks Jason!
I ended up working with another Tek-Tips expert, Geates, and resolved through a vb script. Not only will I give you a Star, I'll test your solution (when time allows) and report back.

Thanks again!
-Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top