Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Powershell script to find and list directories by modified dateHelpful Member! 

ccoyle (MIS) (OP)
11 Nov 11 11:24
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
 
Helpful Member!  jmeckley (Programmer)
18 Nov 11 12:03
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: Database Connection Management
FAQ732-7259: Keeping the UI responsive

ccoyle (MIS) (OP)
28 Nov 11 13:35
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
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close