Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to use Powershell to recursively go through the home folder

$
0
0
Want to loop through the Home directory and find a folder named tempDocuments. The physical folder structure is like D:\Home\username1\TempDocuments, D:\Home\username2\TempDocuments, D:\Home\username3\TempDocuments.  Need to loop through each users TempDocuments and delete folders older than x days.  I have a script to delete files but cannot figure out how to create a variable and store the username then evaluate the path?

Viewing all articles
Browse latest Browse all 15028

Trending Articles