IBM Support

How can I use TEM to detect files of a particular type on a system?

Technote (troubleshooting)


Problem(Abstract)

We suggest using an action to be run only periodically (not every report) to gather the information, and then a retrieved property can then gather the retrieved information.

Resolving the problem

Searching all disk drives for files can be very resource intensive, so this may be a problem for some installations. For that reason, we recommend using an action to be run only periodically (not every cycle) to gather the information, and then a retrieved property can then gather the retrieved information. For example, to find all of the mp3 files on a system, follow the following steps:

Step 1: Create a Task to generate the list of files

  1. In the TEM Console, select the menu option "Tools", then "Create New Task Message"
  2. In the "Name" field type in a title such as "Task to find .mp3 files"
  3. In the "Message:" field put in a description of the task, such as "This task will search the drive for mp3 files and then write them to the file "mp3files.txt" in the client folder. The action will only run when you apply the task to a computer"
  4. In the "Action" tab, make sure the "Action Script Type" is "BigFix Action Script" and in the "Action Script" field paste the following:

    delete __appendfile
    delete findmp3files.bat
    appendfile @echo off

    appendfile del "{pathname of parent folder of regapp "BESClient.exe"}\mp3files.txt"

    appendfile echo "{"**" & concatenation "**" of pathnames of descendants whose (name of it as lowercase ends with ".mp3") of folders "\" of drives whose (type of it="DRIVE_FIXED") & "**"}" >> "{pathname of parent folder of regapp "BESClient.exe"}\mp3files.txt"

    move __appendfile findmp3files.bat

    wait "{pathname of client folder of site "BESSupport"}\RunQuiet.exe" findmp3files.bat 1>NUL 2>NUL


  5. On the "Relevance" tab, remove any text such as "true" and replace with the following:

    version of regapp "BESClient.exe" >= "5.1"

You now have a Task that will search the drive for mp3 files and then write them to the file "mp3files.txt" in the client folder. The action will only run when you apply the task to a computer. Any computer that you apply this task to will return the path of the .mp3 file. This task will report back "Failed" on computers that do not have mp3 files on the disk drives. You can safely ignore this report.

Note: Avoid having this task run continuously, since it is very resource intensive, and local users will probably notice the disk access. You can, for example, have this task constrained to run when no user is present to minimize its impact.

Step 2: Create a Retrieved Property

  1. Select the menu "Tools" then "Manage Properties"
  2. Click the "Add New" button.
  3. In the "Name:" field enter something like "MP3 files". In the "Relevance" field enter the following:
    if exists file "mp3files.txt" of parent folder of regapp "BESClient.exe" then if size of file "mp3files.txt" of parent folder of regapp "BESClient.exe" > 10 then (substrings between "**" of (lines of file "mp3files.txt" of parent folder of regapp "BESClient.exe")) else "N/A" else "No MP3 files"

Historical Number

322

Document information

More support for: IBM BigFix family

Software version: Version Independent

Operating system(s): Platform Independent

Reference #: 1505913

Modified date: 22 May 2015


Translate this page: