\uD83E\uDD14 Problem
When using the SDK functions as a different user than the one currently logged in.
\uD83C\uDF31 Solution 1
Missing database connection info in the user registry
Start the CapaInstaller Console with runas on the device where the script need to be executed
Add Servername and Database name and close the console
Test the script again