Monday, November 23, 2015

Export Specific File Types and Sizes

We recently went through a large PST migration to Office 365. As part of the project, we needed to identify the PST files on our file servers.

This command was useful to search the home directory of all of our users on that specific file server:

G:\Users> forfiles /s /M *.pst /c "cmd /c echo @path @fsize" > C:\temp\PST-Files.txt

The nice thing about this command is that exports the list into a format that includes full path and file size like this:

"G:\users\Jsmith\2006.pst" 1020650496
"G:\users\Jsmith\2007.pst" 1169466368
"G:\users\Jsmith\2009.pst" 1001604096
"G:\users\Jsmith\2010.pst" 97534976
"G:\users\Jsmith\2011.pst" 271360
"G:\users\Jsmith\2012.pst" 271360

Thanks to this post for the syntax help: http://www.dostips.com/forum/viewtopic.php?f=3&t=5899

No comments: