Hello there!
We have found a workaround for deleting the IP locations. Please make sure to take a backup before attempting to do so, and carefully test the results before moving on. Backup instructions can be found here: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
To run the script on the database:
- First, 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.
- Run the below code on the database, either through the databasemaintenance tool in your Lansweeper installation's Tools folder or through SQL Server Management Studio directly.
- Restart the services.
- you should now be able to delete the IP location
Script (replace INSERT IP LOCATION NAME HERE with the name you'd like to delete):
Use lansweeperdb
DECLARE @counter INT;
Declare @locationID INT;
SET @locationID = (select top 1 LocationID from tsysiplocations where IPLocation='INSERT IP LOCATION NAME HERE')
SET @counter =
(
SELECT COUNT(assetid)
FROM tblassets
WHERE locationid = @locationid
);
WHILE(@Counter >= 1)
BEGIN
UPDATE tblassets
SET
tblassets.LocationID = -1
WHERE Assetid IN
(
SELECT TOP 1 assetid
FROM tblassets
WHERE LocationID = @locationid
);
SET @counter = @counter - 1;
END;