In my environment, the Lansweeper database is stored in MSSQL. I installed the SQL Server PowerShell module and use it to directly interact with the SQL database.
Once the module is installed, you can use a command like the one below ran from a user's workstation to get their assets. I don't think this is the best way to achieve this goal though as you'd have to install the SqlServer module on every endpoint and then you'd have to leave credentials on the machines to access it.
If you must use a script that runs from the user's machine, I'd recommend setting up a scheduled task on a server that exports a CSV to a file share every 10 minutes using the SqlServer module and a SQL query. The query could get all unique assets by name and the user associated with it. Then the script you're running on the client workstations can simply access the CSV and it will refresh every 10 minutes.
What exactly are you trying to accomplish?
# Get User name from WMI
$userName = Get-CimInstance -ClassName win32_computersystem | Select -ExpandProperty Username
# Remove Domain name from string if it exists
if ($userName -like '*\*'){
$userName = ($userName -split '\\')[1]
}
# Get Asset name from user
$assetName = Invoke-Sqlcmd -ServerInstance LANSWEEPSERVER\LANSWEEPER -Database lansweeperdb -ConnectionTimeout 30 -QueryTimeout 300 -Username "abcdefgh" -Password "12345678" -Query "SELECT AssetName FROM tblAssets where username = '$userName'"