Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scripting help... get list of files with owner and date
Message
Information générale
Forum:
Windows
Catégorie:
Administration & Sécurité
Divers
Thread ID:
01108105
Message ID:
01108570
Vues:
13
Hi Alex,

This will give you all the information you need, I believe:
'Filelist.vbs
Option Explicit
Dim lcFolder, oShell, oFolder, oFSO, i,oReportFile,child
lcFolder="c:\"
'or lcFolder="\\ComputerName\ShareName" for network PC

Set oShell = Createobject ("Shell.Application")
Set oFolder = oShell.Namespace (lcFolder)

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oReportFile = oFSO.CreateTextFile("c:\outfile.txt", True)

For each child in oFolder.Items
        oReportFile.Write child.name + ", size  " & child.size & ", owner "& oFolder.GetDetailsOf (child, 8) & _
	 ", date modified "& oFolder.GetDetailsOf (child, 3) & ", date created "& oFolder.GetDetailsOf (child, 4) & _
		", date accessed "& oFolder.GetDetailsOf (child, 5) & chr(13) + chr(10)
next

oReportFile.Close
>My boss asked me to: 'find any files that have been written to a folder since yesterday that are bigger than 1 MB so I can go and yell at their owners to remove them'.
>
>The idea is to check on a daily basis (or weekly) for big files that shouldn't be in our share folders. We have a mix of W2K, XP and W2K3 servers and workstations.
>
>I've been looking at different programs for this like:
>
>Jam-Software TreeSize - http://www.jam-software.com/treesize/index.shtml
>AvniTech Solutions ShowSize - http://showsize.com/?did=tcw
>
>But I have come to the realization that this should be somewhat easy to script:
>
>Get list of files including ownership, written date, full path
>Parse the list to show files > 1 MB AND Date > yesterday's date
>
>Problem is, I have no idea of how to tackle this... Do we have scripters around? If so, would you mind giving me some pointers? Is there a better forum/category for this?
>
>
>Thanks in advance!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform