Batch Scheduler Command Line

FlexNet Manager Suite 2022 R1 (On-Premises)

Command-line reference for the server-side batch scheduler.

The command line syntax and results are identical for the two forms of the command-line utility for the batch scheduler service (BatchProcessTaskConsole.exe for interactive use, and BatchProcessTask.exe for programmatic use). These utilities exist solely for interpreting input and sending messages to the batch scheduler service.
Note: The command-line syntax documented below works in the Windows command window. These commands are not suitable for use in the PowerShell interface.
When you input a command (either through the console, or programmatically through a scheduled task):
  • BatchProcessTask[Console].exe validates the command line (this requires that the task name is valid, and parameters are specified appropriately for the scope of the task). Valid command lines are sent as a message to the batch scheduler service.
  • The batch scheduler service checks against the list of pending tasks for duplicate messages (duplicates have the same task, group name, tenant UID, and parameter set). When a duplicate is detected, the original queued task is preserved, and the new command is not queued, but is saved in the database with the state Duplicate.
  • The batch scheduler service persists the command to the database (protecting against unexpected shut-down, so that the system resumes cleanly after a restart).
  • The batch scheduler service adds the command to the pending queue. It reviews this queue (from oldest to latest) regularly, and passes any task that is free of restrictions in a message to the batch processor service.
For more details, see How Batch Scheduling and Processing Works.

Synopsis

To allow real-time updates to a high-availability (running) system, BatchProcessTask[Console].exe is invoked by ShadowHostWin.exe to ensure that the process runs in its own application domain. For more information, see Updating a Running System: Shadow Copy.

Tip: The default path to the executables is C:\Program Files (x86)\Flexera Software\FlexNet Manager Platform\DotNet\bin.
ShadowHostWin.exeBatchProcessTask[Console].exe run taskName [options] [--taskArguments]


-g groupName (applicable only to very large, multi-compliance-database implementations)
-p
-t  tenantUID (applicable only to multi-tenant implementations, for managed service providers)

The leading set of options have limited applicability, and are uncommon for on-premises implementations:

Type Value Description
-g groupName
Not relevant to, and must not be used with, on-premises installations. For multi-database implementations, this means to run the task for all tenants in the specified group.
Note: With this option, a tenant UID must not be specified in the command line.

Groups apply only to very large implementations where the compliance data is split over multiple databases. The group identifies which database contains data records for the set of tenants. For on-premises implementations, this option must be omitted.

-p

Pass properties to the batch processor that customize its behavior for certain tasks. These properties are not passed through as arguments to any executable that the batch processor may call in a sub-process. (For that purpose, use the –- taskArguments format.) Instead, these properties modify the behavior of the batch processor itself. Properties must be specified in name=value pairs, and multiple pairs may be separated by commas.

Example: To modify InventoryImportReaders to also run the database writers for a specific connection, add this property: -p "ChainWritersMessage=true". The complete command (entered on a single line) in this example becomes:
BatchProcessTask[Console].exe 
    run InventoryImportReaders 
    -p "ChainWritersMessage=true"
-t TenantUniqueID
In a multi-tenant environment, runs the task only for the tenant specified by the unique identifier. (This alphanumeric code is viewable in the Flexera license details, and in the Tenant table in the database.)
Note: If a task is scoped to a tenant, and the -t option is omitted on the command line, BatchProcessTaskConsole.exe queues a separate message for every tenant in the database. These messages are then prioritized and processed as usual by the batch scheduler service.

For single-tenant on-premises implementations, this option should be omitted, and has no effect.

Tasks and Task Arguments

The following table lists the available task names, together with the scope of each task. The scope (System, Group, or Tenant):
  • Specifies who is affected by an instance of the task (for example, ActiveDirectoryImport, which has a scope of Tenant, imports the AD information for a single tenant). System tasks are global, and must not have either a group name or a tenant ID specified. For an on-premises implementation, Group scope is equivalent to System scope.
  • Maps to the options described above, so that, for example, in a multi-tenant implementation for a managed service provider, ActiveDirectoryImport requires that the -t TenantUID option is specified to the batch scheduler service (if omitted at the command line, BatchProcessTaskConsole.exe queues a separate message for every tenant in the database).
  • Describes the level of isolation for each task. For example, the ActiveDirectoryImport task cannot be run in parallel (that is, only one instance may run at a time) within its scope of a single tenant. However, in a multi-tenant environment, separate tenants may be running this task at the same time, as long as for each tenant exactly one instance of the task is running. (For more details about restrictions and constraints about what cannot be run in parallel, see Batch Processing Constraints.)

The task arguments are not required for standard operation. The batch processor service adds a standard set of arguments for each task (in the table, shown with the "Underlying executable" entry). If you are customizing behavior, you may add additional task arguments, which are appended to the standard set (you cannot override the standard arguments). If you are adding task arguments, each set must be preceded by two dashes ('minus minus'), which indicates that the argument(s) are to be passed through directly to the executable invoked when processing the task. The set of arguments must then be enclosed in double quotation marks if they contain any white space.

Task Scope Notes
ActiveDirectoryImport Tenant

Import sites, subnets, computers, groups, and users from Active Directory. There should be no need to trigger this task manually, nor to schedule it separately, as the appropriate message is queued by mgsimport.exe after importing an uploaded file to the inventory database.

Tip: When Active Directory data is uploaded from an inventory beacon, a Microsoft scheduled task triggers its import into the inventory database (this task by default runs every 10 minutes). At the successful completion of this import, a message is queued for the batch scheduler to schedule ActiveDirectoryImport for the connection to the inventory database. The bottom line is that Active Directory data is available in the web interface of FlexNet Manager Suite as quickly as possible after it is scheduled for collection on any inventory beacon.
Underlying executable:
ComplianceReader.exe -s connectionName -e ActiveDirectory
ActivityLogHistoryDelete Tenant

Clean up any records in the system activity log that are older than (by default) 90 days.

Underlying executable: SQL stored procedure.

ARLCleanup System
This task cleans up previously-downloaded library files (both .cab files and extracted files) from the disk caching area. Despite the name, it cleans up all downloaded libraries.
Tip: It is not necessary to schedule or execute this task. In normal operations, the batch scheduler automatically schedules a cleanup before starting a new libraries download. If you run this as a task using BatchProcessTask[Console].exe, the clean-up is queued and run safely. If you choose to run this manually with the command line below, take particular care that you do not do so while ARLDownload or ARLImport are in progress.
Underlying executable:
MgsImportRecognition.exe -c
ARLDownload System

Downloads the latest version of the Application Recognition Library and related libraries, saving the contents on the batch server for later import (using the separate ARLImport task). The base location for the saved downloads defaults to %PROGRAMDATA%\Flexera Software\FlexNet Manager Platform\DataImport\Content, and may be customized in the registry of your batch server at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ManageSoft Corp\ManageSoft\Compliance\CurrentVersion\Recognition\ContentImportDirectory.

Because this task downloads all licensed ARL, PURL, and SKU libraries, a failure of any of the downloads means that the subsequent ARLImport will not run.
Tip: If you are managing your own scheduling, you do not need to separately schedule the prior ARLCleanup or following ARLImport tasks. The batch scheduler automatically queues these tasks around each download. (Be advised that the executable command line shown below does not do the prior clean-up and the following import — these are linked only through the BatchProcessTask[Console].exe tasks.)
Note: In a multi-tenant environment for managed service providers, the Application Recognition Library is downloaded once to a shared location, and is then available for import to the system for each tenant. Similarly, the SKU and PURL libraries are downloaded once, and the logical-AND of all tenant entitlements is loaded into the database. Access by individual tenants is then managed by their license terms.

Default schedule: Daily at 1am local time.

Underlying executable:
MgsImportRecognition.exe -dl
Tip: It is important that you use the batch scheduler to run the library downloads and imports. Other imports run at unpredictable times: inventory imports, business imports, and data exchange with FlexNet Manager for Engineering Applications and FlexNet Manager for SAP Applications are all run on demand as data is uploaded by inventory beacons. As well, some imports may be requested by operators using the web interface. If you use the batch scheduler to download the libraries, the batch scheduler will gracefully pause these competing tasks, or wait for their completion, before pushing through the content update, and then resume processing other tasks afterward. In contrast, if you do not use the batch scheduler and run the process directly from the MgsImportRecognition.exe command line, the database locking required for the library updates may mean that either the library update itself, or a competing task, will fail.
ARLImport Group
Import the last downloaded Application Recognition Library, SKU library, EOSL data, and the individual PURL libraries (downloaded as authorized by your license terms), all currently saved on the local disk (see ARLDownload for file locations).
Tip: For normal operations, do not schedule (or execute) this task. In normal operations, the batch scheduler automatically schedules this task after the download of the ARL and other libraries is completed.
Underlying executable:
MgsImportRecognition.exe -g groupName -ia -ne
BaselineImportProcessing Tenant

Used for processing imports of Microsoft Licensing Statements (MLS). Not available for external use.

Underlying executable: SQL stored procedure.

BusinessAdapterConfig Tenant

Updates the data model (FNMPDataModel.ini), the DDI files, and the CSV templates used by the Business Importer (and therefore the Business Adapter Studio). The updated content is downloaded to the inventory beacons the next time they request an update (by default, every 15 minutes, and configurable through Discovery & Inventory > Settings, in the Beacon settings section). This update is particularly valuable for keeping the Business Importer up to date with changes to custom properties. For more information, including details of the standard data model and CSV templates, see the Using FlexNet Business Adapters, PDF file available through the title page of online help. In a multi-tenant implementation, this may be run for a single tenant (with the tenant UID specified), or may be run without the -t option to update all tenants.

Default schedule: Daily at 4am local time. Also triggered when a new tenant license is imported (in a multi-tenant implementation).

Underlying executable: SQL stored procedure.

BusinessAdapterImport Tenant
Imports any packages uploaded by the Business Importer to the central application server, saving the data in the compliance database ready for the next calculation of license consumption (which must be triggered separately).
Note: Although the scope of this task is per tenant (the data for only one tenant is imported at a time), the task can only run one-at-a-time within a group, as logging is shared for all tenants in a group.

Underlying executable: mgsbi.exe

CognosTenantSync System Internal use only. Not available in multi-tenant systems for managed service providers (MSPs). Not invoked in single-tenant on-premises implementations.
DataWarehouseUpdate Tenant

Update the data warehouse with the latest information (to allow for trend reporting and the like).

Default schedule: Weekly on Sunday at 6am.

Underlying executable:
ComplianceReader.exe -e BusinessIntelligenceRights 
-e BusinessIntelligenceData
DataWarehouseUpdateRights Tenant

Copy the tenant list, and update the access rights to the data warehouse.

Default schedule: triggered when a new tenant license is imported.

Underlying executable:
ComplianceReader.exe -us false -importtype Exporters 
-e BusinessIntelligenceRights
EnterpriseGroupImport Tenant

Used for imports through the web interface. Not available for external use.

Underlying executable: SQL stored procedure.

EntitlementRecommendations Tenant

A task triggered through the web interface. Not available for external use.

Underlying executable:
ComplianceReader.exe -us false -e EntitlementAutomation
FNMEAEnterpriseGroupExport Tenant

Transferring current enterprise group structure for use in FlexNet Manager for Engineering Applications. Not available for external use.

Underlying executable: SQL stored procedure.

FNMPDataMaintenance Tenant

Internal database maintenance. Not available for external use.

Underlying executable: SQL stored procedure.

FNMPSoftwareUsageHistoryUpdate Tenant

Internally, takes a snapshot of all licenses to improve reporting performance. Not available for external use.

Underlying executable: SQL stored procedure.

IBMPassportAdvantage Tenant

Used for import of IBM Passport Advantage reports through the web interface. Not available for external use.

Underlying executable: SQL stored procedure.

IMDataMaintenance Group

Executes a database stored procedure for data maintenance within the FlexNet inventory database across all the tenants in the group.

Underlying executable: SQL stored procedure.

IMImport Tenant

Runs the inventory import for FlexNet inventory (collected either by the FlexNet inventory agent locally installed on the inventory device, or by the FlexNet inventory core components operating from an inventory beacon to take zero-footprint inventory). The data is taken from the inventory database (regarded now as a data source), and copied into the staging tables within the compliance database by the inventory reader. It then queues a InventoryImportWriters task. By default, this import occurs daily at midnight.

This task is intended for tenants in the cloud-based implementation. For these tenants, any third-party inventory is collected by disconnected inventory beacons (those not installed on the central application servers), and immediately uploaded, and imported on demand. For such tenants, only the FlexNet inventory remains to be imported prior to queueing the writers.

Underlying executable: ComplianceReader.exe

IMTenantDataMaintenance Tenant
Invoked in either:
  • A single-tenant, on-premises implementation
  • A multi-tenant implementation, where it is run separately in the context of each tenant.
If invoked, this task cleans up records of Oracle database instances that have not appeared in Oracle inventory for a configurable amount of time. To manage the setting, navigate to the system menu ( in the top right corner) > System Settings > Inventory tab, and see the control in the Oracle Database instances section. For more information, see the online help for that page.

Underlying executable: SQL stored procedure.

InventoryImport Tenant
This task is a single invocation for a complex of inventory import and license consumption calculations, in a single convenience command for on-premises implementations only. With the first form of task arguments shown, inventory from all available connections is imported and processed. Export to the data warehouse is specifically excluded. You can also restrict this command to a single inventory source with the -s task argument, followed by the connection name. For example, adding
---s """FlexNet Manager Suite"""
will restrict processing to the default connection for inventory gathered by the FlexNet inventory agent and saved in the internal inventory database.
Tip: The 'triple-dash' format shown above is a special case for task arguments that are passed through unaltered to the underlying executable (in this case, ComplianceReader.exe).

This task is intended for use on-premises, where it is possible that there are third-party inventory connections on an inventory beacon co-installed on the batch server. For these connections, there is no intermediate staging file, and no import on demand (as there is for connections exercised on disconnected inventory beacons). For this reason, all locally-available connections are imported before also importing FlexNet inventory, and queueing the writers.

Default schedule: Daily at 2am local time.

Underlying executable:
ComplianceReader.exe -us false 
-d BusinessIntelligenceRights 
-d BusinessIntelligenceData
-t tenantUID
InventoryImportNoStats Tenant

This task is queued when an operator (in the Administrator role) selects the Update inventory check box and clicks the Reconcile button in the web interface. The name arises because this process, for speed, skips updating database statistics.

Underlying executable:
ComplianceReader.exe -us false 
-d BusinessIntelligenceRights 
-d BusinessIntelligenceData 
-it ReadersAndWriters
-us false
InventoryImportReaders Tenant

By default, runs the import from all data connections (and all pending data packages) specified for the tenant into the staging tables within the compliance database. For inventory collected by FlexNet inventory agent, the data that has been uploaded into the internal inventory database is imported (that is, the inventory database is treated as another connection).

If this task is invoked with the following property:
-p "ChainWritersMessage=true"

and completes successfully, an InventoryImportWriters task is automatically triggered. This means that third-party inventory in particular is available as soon as possible (for details, see Rapid Processing of Third-Party Inventory).

Default schedule: None (instead, for scheduled imports, see InventoryImport).

Underlying executable:
ComplianceReader.exe -us false 
-d BusinessIntelligenceRights 
-d BusinessIntelligenceData 
-importtype Readers
InventoryImportSpreadsheet Tenant

Queued when an operator performs a one-off inventory spreadsheet upload through the web interface. Not available for external use.

InventoryImportWriters Tenant

Takes the data currently available in the staging tables within the compliance database, de-duplicates records as necessary, writes the results into the main data tables of the compliance database, and calculates the resulting license consumption.

Default schedule: None (instead, see InventoryImport).

Underlying executable:
ComplianceReader.exe -us false 
-d BusinessIntelligenceRights 
-d BusinessIntelligenceData
-importtype Writers
LicenseReconcile Tenant

Runs only the license consumption calculations of the compliance writers (that is, does not include writing the last data from the staging tables into the compliance database).

Underlying executable:
ComplianceReader.exe -us false 
-e LicenseReconciliation
POLineImport Tenant

Queued when purchases are imported through the web interface. Not available for external use.

Underlying executable: SQL stored procedure.

SAPInventoryImport Tenant Import inventory from FlexNet Manager for SAP Applications.

Default schedule: Daily at 10pm batch server time.

Underlying executable:
SAPReader.exe -b
SAPPackageLicenseImport Tenant

Import the licenses calculated by SAP, writing results into the compliance database.

Default schedule: Weekly on Sundays at 6am.

Underlying executable:
ImportPURL.exe -l SAPPackages
SAPTransactionProfileImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

SAPUserAndActivityImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

SAPUserConsumptionImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

SAPUserImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

SAPUserRecommendationsExport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

SAPUserRoleImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

ServiceNowExport Tenant

Export data to ServiceNow, based on the integration set up between ServiceNow and FlexNet Manager Suite. May also be trigger by operator activity in the web interface.

Default schedule: Weekly on Sundays at 3am.

Underlying executable: fnmp_servicenow_export.exe

UserAssignmentImport Tenant

Internal use. Not available for external use.

Underlying executable: SQL stored procedure.

FlexNet Manager Suite (On-Premises)

2022 R1