Configuration Tips : Move User Preferences to Non-default Locations

Background

For decades canny administrators have been locating MicroStation's user preferences on a server share for ease of management and, most importantly, to enable user profiles to roam with each user in situations where IT does not roam user profiles.

For a the same length of time Bentley has been recommending that user preferences are always stored locally, largely because the UPF file is written to very frequently during normal operation so network latency can affect application performance. Corrupt user preference files have been a noticeable support topic when located on network shares, generally on poor networks with high latency.

Until recently MicroStation CONNECT Edition did not allow complete relocation of user preferences, every file except the crucial UPF could be relocated. This changed in Update 13 when code changes enabled the value of the _USTN_USERCFG variable to be modified.

This enables user preferences to be located in specified folders, three potentially useful scenarios are outlined below.

The preferable option is to use IT system tools to enable user profiles to roam.

2. and 3. are both subject to the caveat that the frequent read/write operations to the UPF may be affected in 2. by OneDrive sync operations and in 3. by network latency.

Note: In all cases the value of the parent _USTN_HOMEROOT variable is modified, not  _USTN_USERCFG itself.

The most appropriate file in which to make these and related configuration changes is WorkSpaceSetup.cfg. In a Custom Configuration this would be the first CFG file to be read, e.g.: "F:\BB\BB_Configuration\WorkSpaceSetup.cfg"

The existing definition of _USTN_USERCFG needs to be removed using the '%undef' operator, then replaced with the new one and the path to the whole set of preference file must be set.

1. How to Move User Preferences to a Non-default Local Drive Location

To change the location on a local drive:

%undef _USTN_USERCFG
    _USTN_USERCFG = $(_USTN_HOMEPREFS)/Personal.ucf
_USTN_HOMEROOT = $(APPDATA)/BentleyUserPrefs/MCE_User/

This would resolve to =C:\Users\<UserName>\AppData\Roaming so could work well if admins enable roaming user profiles

2. How to Move User Preferences to OneDrive

To locate the preferences in OneDrive folders Windows Environment Variables should be used. These automatically resolve to each active user name.

There are three:

  • OneDrive=C:\Users\<username>\<OneDrive for buiness name>
  • OneDriveCommercial=<username>\<OneDrive for buiness name>
  • OneDriveConsumer=<username>\OneDrive

Note, if you change the location of your consumer OneDrive folders via the OneDrive settings, the value of OneDriveConsumer will reflect that change.

Two variables need to be changed to relocate all user preferences, _USTN_USERCFG and _USTN_HOMEROOT. Changing _USTN_HOMEROOT will modify _USTN_HOMEPREFS.

The following statement in WorkSpaceSetup.cfg will effect the change; to avoid any confusion with personal OneDrive folders the OneDriveCommercial variable is used:

%undef _USTN_USERCFG
    _USTN_USERCFG = $(_USTN_HOMEPREFS)/Personal.ucf
_USTN_HOMEROOT = $(OneDriveCommercial)/BentleyUserPrefs/MCE_User/

This example path allows for separate preferences folder (e.g. MCE_User, OBD_User, etc.) where multiple Bentley applications are in use.

The folders that will contain the preferences need to be created in advance using a simple batch file or login script, similar to those used in CONNECT Edition - Deploying or Updating ConfigurationSetup.cfg.

If you do not use OneDrive, a similar configuration could be used with other file sharing products, just put the appropriate path in the _USTN_HOMEROOT statement.

3. How to Move User Preferences to a Network Share

Storing user preferences on a network share was common practice for V8i. The same procedure described above can be used in this scenario but with a statement similar to this:

%undef _USTN_USERCFG
    _USTN_USERCFG = $(_USTN_HOMEPREFS)/Personal.ucf
_USTN_HOMEROOT = <MyNetworkSharePath>/BentleyUserPrefs/MCE_User/

This approach does not have the advantage of synchronising user preferences to the local drive so can be vulnerable to network latency.