It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda RMM
formerly Managed Workplace

Adding a user as DB Owner for MWData

  • Last updated on

In some cases, users may not have added MWService as a db_owner for the LPIMWOMEXPRESS\MWData database on their Onsite Manager when migrating, making troubleshooting unnecessarily tricky. This article provides instructions on how to add MWService (or any other account) to the database as a db_owner so you can connect to it (e.g. with SQL Management Studio)

Before following this article, try logging into Management Studio using the sa account. If you cannot log in, you can attempt to reset the password by following this Microsoft Article, otherwise, contact Barracuda RMM Support for assistance.

This command, in full, creates the user within the SQL instance, gives the user db_owner to the MWData database, and finally gives the user the sysadmin role.

  1. Save this code block, or download the attached to a working folder (e.g. c:\Temp) as a ps1 file updating the account variable with the one for the user that needs to be made an administrator:

    $account = 'DOMAIN\mwservice'; ### CHANGE THIS FOR THE ACCOUNT YOU WANT TO ACCESS MWDATA ###
    $query_create_user = 'CREATE USER [{0}]' -f $account;
    $query_make_dbowner = 'EXEC sp_addrolemember ''db_owner'', ''{0}''' -f $account;
    $query_make_sysadmin = 'EXEC sp_addsrvrolemember ''{0}'', ''sysadmin''' -f $account;
    add-type -assemblyname system.data;
    [uint32]$hklm = 2147483650;
    $reg = [wmiclass]'root\default:stdregprov';
    $installkey = 'software\level platforms\managed workplace\onsite manager\install';
    $constr = $reg.getstringvalue($hklm, $installkey, 'connectionstring').svalue + ';database=mwdata';
    function Execute-Sql([string]$query) {
    $connection = new-object system.data.sqlclient.sqlconnection;
    $connection.connectionstring = $constr;
    $connection.open();
    $cmd = $connection.createcommand();
    $cmd.commandtext = $query;
    $result = $cmd.executenonquery();
    $connection.close();
    $result;
    }
    Execute-Sql $query_create_user;
    Execute-Sql $query_make_dbowner;
    Execute-Sql $query_make_sysadmin;
  2. Open Powershell or command prompt as an administrator and run:

    CD "C:\Program Files (x86)\Barracuda RMM\Onsite Manager\Bin"
    .\paexec.exe -i -s -d powershell

    or

    CD "C:\Program Files (x86)\Level Platforms\Onsite Manager\Bin"
    .\paexec.exe -i -s -d powershell
  3. In the new Powershell window that appears, run the ps1 file, eg. C:\Temp\admin.ps1

If this is successful, you will see three -1 entries.