Skip to content
  • There are no suggestions because the search field is empty.

Lansweeper API or Static

This document explains how to connect the Lansweeper API directly or to extract data from Lansweeper on-prem and upload it into the Microsoft Deployment Manager (MDM) app.

API Connection

Connect the API in under 5 minutes:

Before You Start

Ensure you have:

  • A Lansweeper Cloud instance set up

  • Admin access to your Lansweeper environment

  • Access to the Lansweeper App Token feature for generating credentials

Connection Steps

1. Log into Lansweeper Cloud

2. Navigate to API Access

  • In the left-hand menu, go to Settings > Developer tools.

  • Select API clients and then ADD NEW API CLIENT

3. Create a API Client

  • Select Personal Access Token (PAT)

  • Give the API a recognizable name (e.g. Licenseware Connector).

  • Select Licenseware in the integrations drop down. 

  • Click continue

4. Create token

  • Select the length of type the API token should be active

  • Select which sites should sync data with Licenseware

  • Click Allow

5. Copy token

  • Copy the API Token to your keyboard

5. Connect via Licenseware

  • In Licenseware, navigate to the Integrations section.

  • Choose the Lansweeper Cloud and configure the Application Identity Code by submitting your API key copied from the previous step.

  • Click Save.

6. Initiate Import

  • Tick on the relevant data sync's for the applications you are interested in.
  • Licenseware will establish a connection and begin retrieving your software and asset data via the Lansweeper API.

  • Once complete, data will be available for processing within the relevant apps (e.g. Software Inventory Manager, Java Deployment Manager, etc.).

 

Troubleshooting Tips

  • The processing can take up to 24 hours to complete, allow sufficient to elapse to ensure the initial data sync can occur. 
  • If the sync is occurring you will see a red wheel on the reports in the report section.
  • If the token is invalid or expired, you will need to generate a new one.

  • Make sure the API token has correct permissions assigned.

  • Double-check the Site ID—it must match your current Lansweeper Cloud environment.

  • Ensure firewalls or network policies allow outbound HTTPS connections to Lansweeper’s API endpoint.




Static Data

 

Static Data Extraction

Lansweeper

Lansweeper has a SQL DB component that stores the data it collects. In order to query the DB, you’ll need to satisfy the following requirements:

  • Install Lansweeper
  • Make sure that you have access to the Lansweeper installation

Once the above requirements are satisfied, you can execute the Licenseware Queries for Lansweeper. In order to do that, you’ll need to follow these simple steps:

  • Open Lansweeper
  • Login
  • Go to Reports
  • Click on Reports and select Create New Report
  • Add the name (Title) as per the naming convention below depending on the query you are going to run;

When saving and exporting the reports, please make sure that you use this naming convention:

  • “lansweeper_software_inventory” for the software inventory query;
  • “lansweeper_installed_software” for the installed software query;
  • “lansweeper_hardware_inventory” for the hardware query;

Licenseware Queries for Lansweeper


Use the following queries to extract the hardware and software data required for analysis.

Lansweeper Hardware Inventory


Copy/Paste the following script in Lansweeper to extract the relevant hardware data.

SELECT
DISTINCT tblassets.AssetID AS SoftwareAssetID,
tblassets.AssetName AS AssetName,
COALESCE(
tblOperatingsystem.Caption,
tblLinuxSystem.OperatingSystem
) AS OperatingSystem,
tblassetcustom.Manufacturer AS Manufacturer,
tblComputersystem.Model AS Model,
tblassetcustom.SystemSKU AS SystemSKU,
tblassets.NrProcessors AS NrProcessors,
tblassetcustom.Serialnumber AS Serialnumber,
COALESCE(
tblProcessor.Manufacturer,
tblLinuxProcessors.Manufacturer
) AS ProcessorManufacturer,
COALESCE(tblProcessor.Caption, tblLinuxProcessors.Family) AS ProcessorModel,
tblassets.Domain AS Domain,
tblProcessor.NumberOfCores AS NumberOfCores,
CASE
WHEN tblProcessor.NumberOfLogicalProcessors / tblProcessor.NumberOfCores = 2
THEN 1
ELSE 0
END AS HyperThreading,
tblComputersystem.SystemType AS SystemType,
CASE
WHEN tblassets.AssetID NOT IN (
SELECT
tblHyperVGuest.AssetID
FROM
tblHyperVGuest
) AND
tblassets.AssetID NOT IN (
SELECT
tblVmwareGuest.AssetID
FROM
tblVmwareGuest
) AND
tblassets.AssetID NOT IN (
SELECT
tblCitrixGuest.AssetID
FROM
tblCitrixGuest
)
THEN 0
ELSE 1
END AS VirtualFlag
FROM
tblassets
LEFT JOIN tblassetcustom
ON tblassets.AssetID = tblassetcustom.AssetID
LEFT JOIN tsysassettypes
ON tsysassettypes.AssetType = tblassets.Assettype
LEFT JOIN tblProcessor
ON tblassets.AssetID = tblProcessor.AssetID
LEFT JOIN tblLinuxProcessors
ON tblassets.AssetID = tblLinuxProcessors.AssetID
LEFT JOIN tblOperatingsystem
ON tblassets.AssetID = tblOperatingsystem.AssetID
LEFT JOIN tblComputersystem
ON tblassets.AssetID = tblComputersystem.AssetID
LEFT JOIN tblHyperVGuest
ON tblassets.AssetID = tblHyperVGuest.AssetID
LEFT JOIN tblVmwareGuest
ON tblassets.AssetID = tblVmwareGuest.AssetID
LEFT JOIN tblCitrixGuest
ON tblassets.AssetID = tblCitrixGuest.AssetID
LEFT JOIN tblLinuxSystem
ON tblassets.AssetID = tblLinuxSystem.AssetID
LEFT JOIN tblLinuxBios
ON tblassets.AssetID = tblLinuxBios.AssetID
WHERE
tblassetcustom.State = 1 AND
tblassets.Assettype = -1

Export the table data as is, and do not alter the column headers.

When exporting the report, rename the file “lansweeper_hardware_inventory”


Lansweeper Software Inventory


Copy/Paste the following script in Lansweeper to extract the relevant software inventory data.

Select Distinct Concat(tblSoftwareUni.SoftwarePublisher, '_', tblSoftwareUni.softwareName, '_', tblSoftware.softwareVersion) As SoftwareKey,
    tblSoftwareUni.SoftwarePublisher As SoftwarePublisher,
    tblSoftwareUni.softwareName As softwareName,
    tblSoftware.softwareVersion As softwareVersion
From tblSoftware
    Left Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID


Export the table data as is, and do not alter the column headers.

When exporting the report, rename the file “lansweeper_software_inventory”

Lansweeper Installed Software


Copy/Paste the following script in Lansweeper to extract a mapping of installed software per device. 

Select Distinct tblSoftware.AssetID As SoftwareAssetID,
    Concat(tblSoftwareUni.SoftwarePublisher, '_', tblSoftwareUni.softwareName,
  '_', tblSoftware.softwareVersion) As SoftwareKey
,tblAssets.AssetID As AssetID
From tblSoftware
    Left Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
    Left Join tblAssets On tblAssets.AssetID = tblSoftware.AssetID
Where tblAssets.Assettype = -1


Export the table data as is, and do not alter the column headers.

When exporting the report, rename the file “lansweeper_installed_software”