Hello there!
If you have many switches in your network, this might indeed be a cumbersome task, so what you could also do is run a database script to clean up all your switches at once. We have provided a script below. This script will delete any MAC address in tblSNMPAssetMAC if the Lastseen date for the MAC is smaller than the Lastseen date of the switch. The script will delete this information for all switches, so it must only be run once. To run the script, follow the steps below:
- Just to be safe, we do recommend performing a database backup prior to running any scripts. Do not skip this step. Backup instructions can be found here: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
- Stop the following services:
- The Lansweeper server service (on all your scanning servers).
- The web server service on your Lansweeper web server. Your web server service is either World Wide Web Publishing Service (IIS) or IIS Express.
- Afterward, open the DatabaseMaintenance.exe tool, which can be found under Program Files (x86)\Lansweeper\Tools on your Lansweeper server or, alternatively, use SQL Server Management Studio if your Lansweeper database is hosted on SQL Server.
- Copy/paste the script below in the second tab labeled Script Execution, and click Execute.
- Restart your services.
DELETE tblSNMPAssetMac
FROM tblSNMPAssetMac
INNER JOIN tblAssets On tblSNMPAssetMac.AssetID = tblAssets.AssetID
WHERE tblAssets.Lastseen > tblSNMPAssetMac.LastSeen