You are seeing duplicate entries in the software history report.
What happened?
In one of our earlier releases, an issue was discovered that created duplicate entries in the software history table. The issue was fixed in our 10.2.5.0 release.
Now what?
Automatic cleanup
After upgrading to version 10.2.5.0, the duplicate entries should be cleaned automatically by the Lansweeper cleanup options. However, this will take a while, and they are consuming unnecessary space in the Lansweeper database.
Cleaning them instantly
The fastest solution to get rid of these duplicates is to run the below SQL script.
- First, backup your database before running any cleanup script. Do not skip this step.
- Stop the Lansweeper scanning service and IIS Express services under services.msc.
- If running multiple scanning services in a distributed Lansweeper setup, stop them all.
- Open Program Files (x86)\Tools\DatabaseMaintenance.exe and run the script below via the Script Execution tab, paste the script into the top window and hit Execute.
WITH CTE AS(
SELECT AssetID, softid, softwareVersion, Installdate, Lastchanged, Action, CurrentUser, msi, MsStore,
RN = ROW_NUMBER()OVER(PARTITION BY installdate,assetid,softid,softwareVersion,Action ORDER BY softwareVersion)
FROM tblSoftwareHist
)
delete FROM CTE WHERE RN > 1