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

File size & Directory audit

$
0
0

I have a server full of millions of files with directory structure that looks a little like this......

\\server\f$\02182014\Random_Name\619026\myfile1.djd

\\server\f$\02182014\Random_Name\619026\myfile2.djd

\\server\f$\02182014\Random_Name\619026\myfile3.djd

\\server\f$\02182014\Random_Name\619027\myfile1.djd

\\server\f$\02182014\Random_Name\619028\myfile1.djd

 

I want to conduct an audit that returns file size (length), and the immediate parent directory name only of all files on a drive name only, and output to a csv.

Eg. for the above, i'd like to recurse drive "f$" for ALL files and return:

"FullPath", "ParentName", "FileName", "FileSize"

"\\server\f$\02182014\Random_Name\619026\myfile1.djd","619026","myfile1.djd","154246"

"\\server\f$\02182014\Random_Name\619026\myfile2.djd","619026","myfile2.djd","45454586"

"\\server\f$\02182014\Random_Name\619026\myfile3.djd","619026","myfile3.djd","14535486"

"\\server\f$\02182014\Random_Name\619027\myfile1.djd","619027","myfile1.djd","145345386"

"\\server\f$\02182014\Random_Name\619028\myfile1.djd","619028","myfile1.djd","1543544"

 

HELP!

 


Viewing all articles
Browse latest Browse all 8411

Latest Images

Trending Articles



Latest Images