Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

delete older than script, expanded to hit multiple folders local and remote

$
0
0

So I have a batch file that collects data on a dozen DC's locally.

I have another batch that runs on one box that goes out via robocopy and pulls all that into a directory - in this one, we'll store all the files forever (or within reason), but I'd like to go out and kill everything older than 30 days off the data collection folders on the DC's.

I've used this before - https://gallery.technet.microsoft.com/scriptcenter/Delete-files-older-than-x-13b29c09

It's perfect, but I don't know how to make it hit all those remote folders.  I can only do one at a time, and I'd rather not make a dozen batch files to call this if possible.

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles