SELECT m.agentGuid, m.machName + '.' + m.groupName AS Machine_GroupID,
b.imageLoc AS imageLocationVol,
b.ftpPath AS imageLocationFldr,
b.backupPass AS imagePassword
FROM dbo.backupParams AS b
INNER JOIN dbo.machNameTab AS m
ON b.agentGuid = m.agentGuid
To access the SQL views, you may need to first get the connection to the database from your script. How did you know the SQL-user ID and the corresponding password? Particularly, when the database user is SQL-user (i.e. SQL authentication). Basically, my question is that how did you get the connection to the database in the first place?
kaseya already has a connection to the DB so as long as the view is in the ksubscribers DB you can reference it.