How to Inventory Windows Machines from a Network Share

Running inventory from a network share involves preparing the network share, running the inventory, and processing each inventory.

The information in this topic applies to Windows machines only.

Part 1: Prepare the Network Share Location

You only need to do this part once.

To prepare the network share location:

  1. Create a network share with read access and, if you plan to use the same location to write the generated output files, write access by other machines.
  2. From a machine that has the CAM Agent installed on it (for example, the administrator’s machine), navigate to C:\Windows\SysWOW64\wex4962 (64-bit versions of Windows) or C:\Windows\System32\wex4962 (32-bit versions of Windows).
  3. Copy the contents of the wex4962 folder to the share.
  4. From CAM Administrator's Machine menu, select Remote Inventory, then select Prepare Agent.
    This will generate an inventory configuration file (config.xml) in the location shown in the Prepare Remote Inventory Agent dialog box.
    This dialog box lists locations for the both Windows-based machines and Mac OS systems.
  5. Navigate to the appropriate location and copy the config.xml file to the share. (You do not need to copy all of the files there, just config.xml. If a config.xml file was copied over in step 3, overwrite it with this one.)

  6. From the machine on which CAM Administrator is installed, navigate to one of the following folders and copy EMInvFS.wsf to the share:
    • On 32-bit machines: C:\Program Files\Cherwell Asset Management\CAM Administrator\InventoryFromShare
    • On 64-bit machines: C:\Program Files (x86)\Cherwell Asset Management\CAM Administrator\InventoryFromShare
  7. Copy ProcessEMInvFS.wsf to the same wex4962 folder you used in step 3 above.

for example, the rest of this topic assumes a share of \\myserver\esminv was created and populated with the files specified in steps 3 and 4 above.

Part 2: Run Inventory

From a share

From a command line prompt on your share, or in your login script:

wscript "\\<inventory files server name>\<inventory files share name>\EminvFS.wsf" /output:"\\<output server name>\<output share name>" /quiet

In the example above, the inventory config file is read, and the inventory agent is launched from \\<inventory files server name>\<inventory files share name>. The resulting inventories are saved to "\\<output server name>\<output share name>

From your local machine

Open a command prompt and use cscript to execute the EminvFS.wsf script:

  • Example with parameters:

    cscript <share location>EMInvFS.wsf [/output:<writable shared location>][/quiet][/debug]

  • Example without parameters:

    cscript "\\myserver\myshare\EMInvFS.wsf"

  • If your source share is read-only and your destination share is read-write:

    cscript "\\myserver\myshare\EMInvFS.wsf" /output: "\\myserver2\myshare2\myfolder\"

Optional parameters:

  • /output:"writable-folder-location"

    Use to specify the output folder into which a subfolder containing the inventory files will be created. If this parameter is not specified, the share folder itself is assumed to be the output folder.

  • /quiet

    Use to run the inventory agent without displaying its user interface; if this parameter is not specified, the user interface is displayed.

  • /debug

    Use to display EmInvFS.wsf script progress messages.

The inventory agent will write its inventory (a set of .xml files) into a subfolder in the output folder (either the share or the folder specified by the /output parameter as described above). The name of the subfolder is of the form esm_<machine-name>yyyymmdd. For example, if the script is run on August 10, 2012 on a machine named JERRY160L and no output folder is specified, the inventory files would be created in \\myserver\esminv\esm_JERRY160L20120810\

Once inventory completes, you can process it for inclusion in the CAM database.

Part 3: Process Each Inventory

You can process the inventory .xml files in one of two ways:

  • From CAM Administrator's Machine menu, select Remote Inventory > Import. Enter (or browse to) the subfolder containing the inventory files (for example, \\myserver\esminv\esm_JERRY160L20120810), and select Import.

    - or -

  • On the machine where the CAM Agent is installed, open a command prompt and use cscript to execute the ProcessEmInvFS.wsf script.
    If you want to be able to run ProcessEMInvFS.wsf from a different machine, copy the ProcessEmInvFS.wsf file to the appropriate location on that machine as well.
  • ProcessEMInvFS.wsf takes the following arguments:
    • /input:"EmInvFS-output-folder"

      This is the folder into which one or more subfolders containing the inventory files are located. If you did not specify an output folder in part 2 above, this is the share folder itself. In the above example, you would specify:

      /input:"\\myserver\esminv"

      All subfolders with names conforming to the convention used to inventory from a share will be processed.

    • /visible

      (Optional) Use this to specify that the user interface of the agent used to process the inventory files will be visible. If you do not specify this, the agent runs without displaying its user interface. Note: If you are processing more than one inventory, you will need to select the agent's Close button after each inventory is processed.

    • /nosummary

      (Optional) Use if you do not want the ProcessEMInvFS.wsf script to display a summary once all inventories have been processed. If you do not use /summary, a message box is displayed.

    • /delete

      (Optional) Use this to specify that each subfolder of inventory data is to be deleted once it has processed. If you do not specify /delete, each folder is renamed once it has been processed by pre-pending "processed_" to the subfolder name. For example, after the inventory contained in esm_JERRY160L20120810 is processed, that folder will be renamed to processed_esm_JERRY160L20120810, so that if the script is rerun at a later date, the folder will not be re-processed.