Custom Inventory rule
This string works, but the report is huge, I need to summarize it. What I need is a total of all office type documents that are stored on each PC in my single organization. The string I am now using is shown below, this works, but it lists every PC and along with the path and the name of the .doc files. It is simply too big. What we are trying to do is figure out how much storage we will need if we want to move all of these documents to a server. I need to know just the count of office docs on each machine and the total size on each.
Thanks in advance.
ShellCommandTextReturn(c:\windows\system32\wbem\WMIC.exe datafile WHERE "drive='c:' AND path like '\\users\\%%' AND NOT path like '%%AppDat%%' AND Extension='doc'" get name)
Community Chosen Answer
if you want to count certain directories like "my documents" and "desktop" you can use powershell like
ShellCommandTextReturn(powershell -command "ls -path C:\users\*\Documents,C:\users\*\Desktop -r|measure -s Length")
ShellCommandTextReturn(powershell -command "ls -path %USERPROFILE%\Documents,%USERPROFILE%\Desktop -r|measure -s Length")
this will get a total for all files in the directories. maybe some else knows the powershell command to add an extension filter to the search