This post was originally published here

This blog helps to perform various operations with BAM views using the command prompt such as:

  • deploy BAM Views
  • remove BAM definitions
  • authorize user accounts for BAM View

First, I have created a BAM view named as “BAMOperation” with the Activities Order and Status with items as shown below.

Business Activity Monitoring BAM Operation Using Command Prompt

Business Activity Monitoring BAM Operation Using Command Prompt

The BAM management utility deployment command line tool, bm.exe., allows to apply, modify, and remove BAM definitions. You can use, amongst others, below commands:

  • deploy-all – Deploys a BAM definition
  • remove-all – Removes a BAM definition
  • update-all – Updates a BAM definition
  • add-account – add accounts on BAM definition

Deploy a BAM View and Activities

The BAM Definition file (BAMOperation.xml) becomes deployed using the BAM Command line utility.

Deploying of BAM definition file will create corresponding database tables, views, etc., which will organize the data in a relational view. Follow the below steps to deploy a BAM View:

  1. Open Command Prompt as administrator
  2. Navigate to BizTalk Server Installation path/ Tracking folder and use the below command:

bm.exe deploy-all –DefinitionFile:” <<FileLocation>> BAMOperation.xml”

Business Activity Monitoring BAM Operation Using Command Prompt

which will deploy a “BAMOperation” view in BAM Portal as shown below.

Business Activity Monitoring BAM Operation Using Command Prompt

Remove a BAM Definition

Administrators can use the remove-view / remove-activity command to remove a view and Activity from the BAM Primary Import database. Follow the below steps to remove an existing activity/view:

  1. Open Command Prompt as administrator.
  2. Navigate to BizTalk Server Installation path/ Tracking folder and use the below command.

To Remove a BAM Definition File:

bm.exe deploy-all –DefinitionFile:” <<FileLocation>> BAMOperation.xml”

Business Activity Monitoring BAM Operation Using Command Prompt

Removing a BAM definition file will remove the related tables, views, etc. which were deployed in the database and server.

Remove a BAM Activity

To remove a BAM Activity, the user needs to remove the BAM View first and then the BAM Activity they wanted to remove. Execute the below-shown command to remove the BAM View first and then the BAM Activity.

To remove a BAM View:

bm.exe remove-view -name: {view name}

Business Activity Monitoring BAM Operation Using Command Prompt

To remove a BAM Activity

bm.exe remove-activity -name: {activity name}

Business Activity Monitoring BAM Operation Using Command Prompt

The above command which will remove the specified activity alone form the database.

Update a BAM Activity

The User is also able to update an existing View/Activity. To update an Activity/ View, the user should remove the activity/view first by using the above-mentioned commands and then follow the below steps to update any changes in the existing View /Activity.

For example, I have removed the above “Status” activity and I have updated the activity as shown below.

Business Activity Monitoring BAM Operation Using Command Prompt

We then use the below command to update the changes to the existing view:

bm.exe update-all –DefinitionFile:” <<FileLocation>> BAMOperation.xml”

The above command will add a table, view in the database and it will update the previous activity in the BAM Portal as shown below.

Business Activity Monitoring BAM Operation Using Command Prompt

Add an Account to BAM Definition

Administrators use the add-account command to associate users with BAM views and protect the BAM Excel Spreadsheet views from unauthorized access. When users save BAM views, the views reference a SQL connection string that is hidden within the workbook. The workbook is protected, but you must also ensure that the document is protected.

When you associate users with BAM views, you restrict access to the views to only the users or groups to whom you grant access by using the below command.

bm.exe add-account -AccountName: DomainName UserName -View:(viewname)

Business Activity Monitoring BAM Operation Using Command Prompt