How to inventory size of a directory with AM

Document ID : KB000092653
Last Modified Date : 20/04/2018
Show Technical Document Details
Introduction:
It could be interesting to do an inventory of the size of a specific directory to check if a cleanup should be done.

For example inventory the size of c:\windows\temp of all machines

How to do the size inventory of a specific directory ?
Instructions:

1- Download the attached file Dir_Size_Inventory.zip and uncompress it in order to get the file Dir_Size_Inventory.dms

2- In ITCM Explorer create a new Asset Jobs and choose Job Type "Script"
 
User-added image
 
User-added image




3- Click Next and give a name to the Job.
Example : Windows Temp Size
 
User-added image



4- Click Next. And load the file Dir_Size_Inventory.dms

Adapt the 2 following lines with name and path of directory :

sDirName="WINDOWS_TEMP"
sDirPath=sWinDir+"\TEMP"

 
User-added image


Examples :
  • For c:\temp
sDirName="SIZE_C_TEMP"
sDirPath="C:\TEMP"
 
  • For C:\ProgramData\Microsoft\Windows\WER
sDirName="SIZE_WINDOWS_WER"
sDirPath=EnvGetstring("ProgramData")+"\Microsoft\Windows\WER"



5- Click NEXT and on "Set Scheduling" button
In Scheduling options, click on Miscellaneous tab and check option "Job is allowed to run unattended"
 
User-added image



6- Click OK and FINISH


7- Attach this job to the computers or group of computers.


8- Inventory will appear like this under Additional Inventory folder :
 
User-added image



The size appears in different unit sizes : Bytes, KBytes, MBytes, GBytes.
The value is rounded to the lowest integer.
 
File Attachments:
Dir_Size_Inventory.zip