notarat
2[H]4U
- Joined
- Mar 28, 2010
- Messages
- 2,501
I manage about 10TB of storage (not much in terms of space) that contains around 6.8 million files and 3.2 million directories that reside on over a dozen servers geographically located around the country
I'm the only one at my work who tracks the shared drive usage for duplicates, unauthorized files, overly large files, old files, etc.
Since the provider of our storage is not "Us", we're restricted to scanning the shares remotely, an we were never given any tools with which to perform scans.
I've seen posts from people who wanted to know how to go about gathering the information so they too can track these kinds of information regarding their network drives, so I thought I'd share my Windows Power Shell 2.0 script that gathers the information.
The script I use differs from the one posted below only in that I stripped out the stuff I had in there that personalized it to my environment.
Measure-Command {get-childitem -recurse | where-object {$_.PSIscontainer -ne $true} | foreach-object {'"'+ $_.name + '" , "' + $_.fullname + '" , "' + $_.length + '" , "' + $_.Extension + '" , "' + $_.CreationTime + '" , "' + $_.LastAccessTime + '" , "' + $_.LastWriteTime + '"' } >c:\outputfiles\hmm.txt}
Measure-Command {....} is not the scan itself, but will record how long it takes the scan to complete. You can remove that portion if you want...
If you have Power Shell 2.0 loaded:
1- Start the ISE
2 - In the Command Line Frame, enter your drive to be scanned (Ex: d: <enter> )
3 - Paste the code in the code window
4 - Click the Run button.
You'll obviously want to change the path c:\Scans\ to wherever you store your results, and name the file however you want.
You can import that directly into MS Access, or open the txt file from Excel
Caveat: I use Office 2010 (work requirement) so I don't have a problem with spreadsheets larger than 65535 rows. However, I use MS Access since I can create more powerful queries in it.
EDITED: Added Quotes around the values to clear up potential issues when importing into MS Access or MS Excel.
I'm the only one at my work who tracks the shared drive usage for duplicates, unauthorized files, overly large files, old files, etc.
Since the provider of our storage is not "Us", we're restricted to scanning the shares remotely, an we were never given any tools with which to perform scans.
I've seen posts from people who wanted to know how to go about gathering the information so they too can track these kinds of information regarding their network drives, so I thought I'd share my Windows Power Shell 2.0 script that gathers the information.
The script I use differs from the one posted below only in that I stripped out the stuff I had in there that personalized it to my environment.
Measure-Command {get-childitem -recurse | where-object {$_.PSIscontainer -ne $true} | foreach-object {'"'+ $_.name + '" , "' + $_.fullname + '" , "' + $_.length + '" , "' + $_.Extension + '" , "' + $_.CreationTime + '" , "' + $_.LastAccessTime + '" , "' + $_.LastWriteTime + '"' } >c:\outputfiles\hmm.txt}
Measure-Command {....} is not the scan itself, but will record how long it takes the scan to complete. You can remove that portion if you want...
If you have Power Shell 2.0 loaded:
1- Start the ISE
2 - In the Command Line Frame, enter your drive to be scanned (Ex: d: <enter> )
3 - Paste the code in the code window
4 - Click the Run button.
You'll obviously want to change the path c:\Scans\ to wherever you store your results, and name the file however you want.
You can import that directly into MS Access, or open the txt file from Excel
Caveat: I use Office 2010 (work requirement) so I don't have a problem with spreadsheets larger than 65535 rows. However, I use MS Access since I can create more powerful queries in it.
EDITED: Added Quotes around the values to clear up potential issues when importing into MS Access or MS Excel.
Last edited: