Portrait Miner qsbuild script running as a scheduled task is not finding the database connection


A Portrait Miner qsbuild script which contains a 'qsimportdb' command runs correctly through the Portrait Miner gui, but when it runs as a scheduled task, it gives an error about not finding the user database connection (UDC).


In Portrait Miner, user database connections (UDCs) are created on a per-user basis and are stored for each user on the server in the %pmhome%\shared\users\<user> folder.  This user folder name contains an optional domain name element (<userid>@<domain>) if the domain is not 'Local'.

This folder is created automatically for each user, either when they login to the Portrait Miner gui, or when they run a Portrait Miner data build command (DBC) such as qsbuild or qsimportdb from the command line.

Care should be taken when using local userid's (i.e. not on a domain) when running scheduled tasks, as these recognise the user as being on the <machinename> domain, so will be looking for a UDC in the %pmhome%\shared\users\<user>@<machinename> folder

A qsimportdb command will fail if it is being run as a user who does not already have a UDC created.


UPDATED: March 24, 2017
In the Portrait Miner client login screen, when you add or edit a server and use the value ‘Local’ as the domain, when the user logs in they get a %pmhome%\shared\users\<userid> folder created.

If you specify any other value for the domain, you get a %pmhome%\shared\users\<userid>@<domain> folder created.
So even though ‘Local’ and ‘<machinename>’ are effectively the same thing, differently named folders get created.

Ensure the domain details are set correctly for the user that the scheduled task will be running as so the UDC is created in the correct folder.
Environment Details
Product Feature: Data Build Utilities