Setting the Feature Level via command line for one or more Windows accounts

  Product(s): WaterCAD, WaterGEMS, HAMMER, SewerCAD, SewerGEMS, StormCAD, CivilStorm, PondPack
  Version(s): CONNECT Edition, V8i
  Area: Licensing

Introduction

The OpenFlows products are licensed by feature levels, for example number of pipes, ponds, inlets, and whether or not AutoCAD integration is possible. See more about feature levels here: How do OpenFlows product licenses work with element limits? (feature levels)

When installing the software and using it for the first time, the user must select the Feature Level that they would like to use (and record usage against). If only one feature level is owned (perpetual license), the feature level will automatically be selected and you will not be prompted to select one. 

However, if you own multiple feature levels or if you have a subscription (such as SELECT OpenAccess, ELS or E365) which gives you access to multiple or all feature levels, you may have a desire to set a certain feature level during the process of installation. For example your software administrator may want to "push" out software to client computers using a script and may want to include a step in the script to select a certain feature level. That way when an end user opens the software it will not prompt them and instead will use the desired feature level. This can help for example if you want to help prevent users from accidentally selecting a feature level that is too high. (for example selecting unlimited pipes and getting billed for it when the user only needs to work on models with a small number of pipes).

Note that users can still manually select a feature level in the Feature Level Selector, so you may want to consider other methods of controlling usage. See: Controlling license access to prevent unintended usage

Solution - SES Licensing in CONNECT Edition

The following section applies to our latest CONNECT Edition versions of the OpenFlows products which use the Subscription Entitlement Services (SES) licensing method - version 10.02.XX.XX and higher. If you are using an earlier version (10.01.XX.XX and earlier, including V8i, which use SELECTServer licensing), please see the other section further down.

Starting with version 11.00.05.34 (and greater) of the CONNECTION Client, (this is a separate program that runs in your Windows System Tray) the ability to set the feature level via a command line argument is available. This can be used by administrators to incorporate into their installation script. These commands can be run using the Command line or in a Batch file for example. If you are using version 11.00.04.15 or earlier of the CONNECTION Client you will need to upgrade to a newer version in order to take advantage of the ability to set the feature level via command line.

To see the syntax for using these command line arguments, run the following:

C:\Program Files\Common Files\Bentley Shared\CONNECTION Client\LicService\Bentley.Licensing.FeatureLevelSelector.exe -help

Single Product: -fs:<product_id>,"feature_string"
Multiple Products: -fs:<product_id>,"feature_string".<product_id>,"feature_string"
Single Product with Overwrite: -fs:<product_id>,"feature_string" -o
Multiple Products with Overwrite: -fs:<product_id>,"feature_string".<product_id>,"feature_string" -o

With Overwrite flag, any existing data/selection will be replaced.


For reference, here are the Product IDs to use for each OpenFlows product that uses feature levels:

WaterCAD: 1248
WaterGEMS: 1249
HAMMER: 1225
SewerGEMS: 1244
CivilStorm: 1207
StormCAD: 1246
SewerCAD: 1243
PondPack: 1233


A typical feature string looks similar to this (using WaterGEMS as an example): acad=yes|agis=yes|mstn=yes|pipe=250. Care must be taken to set the correct feature string with the items in the order that matches what is in your entitlements. To confirm, open the License Tool (from the menu in the CONNECTION Client) and check the tabs at the bottom such as the "Checkout License".

For example if you would like to set StormCAD to use the 25 inlet license without AutoCAD (see screenshot above), regardless of any previous setting, the syntax would be:

Bentley.Licensing.FeatureLevelSelector.exe -fs:1246,"mstn=yes|inlt=25" -o

When this command is run, the license database file will be updated to the desired feature level and when the product is open on the same user account. This can be confirmed by opening the Feature Level Selector.

What if different Windows user accounts are involved?

In some cases you might be installing the software as an Administrator account, whereas the actual users of the software would be signed in under their user account. Or, you may need to set the feature level for multiple users who use the same computer.

For this situation, it is important to note that the command line option explained above will only set the feature level for the current Windows user account. The feature level is stored in a special database file (LicenseService.db) located in the user profile: %UserProfile%\AppData\Local\Bentley\Licensing\

So, if you would like your installation script to set the feature level for other/multiple user accounts, you may need to use "RUNAS" in the script to ensure that the command is run as a specific user account. 

Execute the following command for instructions on utilizing the runas command:
runas /?

This is commonly done by executing the following command, replacing some_user with the name of the user account to use:
runas /user:some_user "%CommonProgramFiles%\Bentley Shared\CONNECTION Client\LicService\Bentley.Licensing.FeatureLevelSelector.exe"

Once prompted for a password, enter it for the specified user, and the Feature Level Selector will be opened as the specified user account.

Solution - SELECTserver Licensing (older versions)

The following section applies to older versions of the OpenFlows product, 10.01.XX.XX and older including V8i. If you are using CONNECT Edition 10.02.XX.XX or greater, please see the information further above.

In these older versions, you might set the default feature configuration in the Municipal License Administrator when logged in as an administrator (such as during installation for end users), but notice that the end user Windows account does not seem to always pick up on that setting. The end users may still be prompted again to select the default feature level.

Depending on the permissions that the Municipal License Administrator (MLA) is opened with and the version of the program, the default feature configuration is either stored in the area of the registry that all users can access, or the area that only the user who set the default can access. See below table for the different variations and the end result. Detailed explanation follows.

Legend

"Version" - "CE" = CONNECT Edition version 10.01.XX.XX and earlier.
"User who set default"
 - "End user #1" means the actual user who uses the product. Admin user means a Admin windows account, separate from the user's Windows account. "End user #2" means a second end user Windows user account who logs in to use the product on the same computer.
"Method of setting default" - was the default set (using either the MLA or the command line console) during installation or after installation. If the latter, was the 64-bit MLA shortcut run, or the 32-bit?
"Default stored in" - indicates the Registry location where the default is stored. "HKCU" = HKEY_CURRENT_USER, "HKLM" = HKEY_LOCAL_MACHINE. HKCU is read by both the 32-bit and 64-bit version of the product, whereas HKLM has separate sections for 32-bit and 64-bit.
"Results for end user #1, 32-bit product" - indicates whether the default feature level is properly read and used by the 32-bit version of the product when opened by the end user Windows account. Note that the 32-bit version is located in the root of the installation folder, but on a 64-bit operating system, a 64-bit instance of the product will also be included.
"Results for end user #1, 64-bit product" - indicates whether the default feature level is properly read and used by the 64-bit version of the product when opened by the end user Windows account. On a 64-bit Operating System, the desktop and Start menu shortcuts will open the 64-bit version.
"Results for end user #2, 32-bit product" - indicates whether the default feature level is properly read and used by the 32-bit version of the product when opened by a second end user Windows account on the same computer. Note that the 32-bit version is located in the root of the installation folder, but on a 64-bit operating system, a 64-bit instance of the product will also be included.
"Results for end user #2, 64-bit product" - indicates whether the default feature level is properly read and used by the 64-bit version of the product when opened by a second end user Windows account on the same computer. On a 64-bit Operating System, the desktop and Start menu shortcuts will open the 64-bit version.


WaterCAD, WaterGEMS, HAMMER, PondPack

SewerGEMS, SewerCAD, StormCAD and CivilStorm


MLA Comparison.xlsx

Detailed explanation of the logic (older versions)


V8i (WaterCAD, WaterGEMS, HAMMER) & CONNECT Edition (SewerGEMS, SewerCAD, StormCAD, CivilStorm)

- If the Municipal License Administrator (MLA) is opened with limited rights, the selected default feature configurations are stored in the HKCU (current user) section of the Windows registry. This area can be read from both the 32-bit and 64-bit versions of the product, on the same user on which account that the default was set.

- If the MLA is opened with admin rights, the selected defaults are stored in the HKLM (local computer) part of the registry, and HKCU. If the default is set during installation, it will be using the 32-bit version of the MLA and thus the default will be stored in the 32-bit area of HKLM (and would only be read by the 32-bit version of the product).

If a different user then logs in and uses the product:

- It first attempts to read the default from the HKCU (current user) section of the registry. This part of the registry is kept separate for each Windows account. If the other user that first set the default had limited rights, this means that the default will not be found. Also, if this second user account had previously set the default, it will be stored in HKCU and the product will pick up on that.

- If nothing is found in HKCU, it attempts to read from the HKLM (local machine) section, corresponding to the "bitness" of the application (meaning, if running the 32-bit version of the product, it will look at the 32-bit area of HKLM). If that first user set the default while running the MLA as admin, then it will find the default that the first user set and use it, assuming the bitness matches (meaning, if the default was set by running the 64-bit MLA and the second user opened the 64-bit version of the product). Again though, if the other/second user had previously set the default, it will have been stored in the HKCU section of the registry and the program would pick up on that before checking HKLM.

So, if you had set the default and then another user logged in later and found that it had reverted to a blank feature string (default not set), and you're using the V8i version, this probably indicates one of the red "default NOT read" entries in the above tables.

CONNECT Edition 10.00.00.49 (WaterCAD, WaterGEMS, HAMMER), CONNECT Edition SS1+ (SewerGEMS, SewerCAD, StormCAD, CivilStorm - not yet available).

A change has been made starting with this release, and the default will always be stored in the individual Windows user account (HKCU). This means that the end user will always need to set the default.

However, the logic to read the default is still the same - it will attempt to read from HKCU first, then if none can be found, it will read from HKLM. So, if you insert the default into the HKLM part of the registry as part of an installation script, then the end users that log in should pick up the default feature configuration from that. Here is the registry location:

[If using the 64-bit version of the MLA or MLA console, found in the x64 subfolder]

HKEY_LOCAL_MACHINE\SOFTWARE\Bentley\Municipal Products Group\Licensing\1.1\Applications\<productID>

Here are the product IDs associated with each product:

WaterCAD: 1248
WaterGEMS: 1249
HAMMER: 1225
SewerGEMS: 1244
CivilStorm: 1207
StormCAD: 1246
SewerCAD: 1243
PondPack: 1233

[If using the 32-bit version of the MLA or MLA console, found in the root of the install folder]

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Bentley\Municipal Products Group\Licensing\1.1\Applications\<productID>

Workaround / Best Practice (older versions)

With the above in mind, if you're an administrator who needs to set up licensing for end users, it may be best to deploy the default configuration in the user-specific (HKCU) section of the registry as part of an install script. This will need to be run on the end user account so as to deploy the default to their HKCU section. It may be possible to incorporate this as part of a login script.

Note that the console-based MLA can be used to set the feature level by command line. This is the Haestad.LicenseAdministrator.Console.exe in the installation folder. More information and syntax can be found in the MLA > Help > Contents > Using the Console Municipal License Administrator.

For example, to set WaterGEMS (product ID 1249) to a 5000 pipe limit, the command should look like this:

C:\Program Files (x86)\Bentley\WaterGEMS\Haestad.LicenseAdministrator.Console.exe /quiet /configure 1249 mstn=yes|pipe=5000

See the table above for the list of Product IDs.

See Also

Setting the correct feature level in the Municipal License Administrator

Recommended
Related