→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ErikT
Lansweeper Tech Support
Lansweeper Tech Support

You've got multiple subnets in your network and created an IP Range scanning target for each one.
Excited to witness Lansweeper's capabilities, you've added all the targets. The results are coming in, and everything seems to function correctly. 

You continue to add other scanning targets to discover the full potential of Lansweeper, but you're noticing a slowdown or clog in the scanning process.

What happened?

By default, every day at 12 pm (local scanning server time), all IP Range scanning targets are scheduled to be scanned automatically.

If you have several of these targets, Lansweeper's scanning service will be busy for a significant amount of time every day at noon. When setting up IP Scanning targets, it's easy to overlook the scheduling options for each target you create. 

Now what? 

To reduce the likelihood of a heavy load, it is recommended to reschedule the IP Range scanning targets to start at a different time of day. However, if you have numerous IP Range scanning targets set up in Lansweeper, rescheduling them individually can be a tedious task. Fortunately, you can use a script to automate the process and let the computer do the heavy lifting.

The script below will randomize each IP Range scanning target:

Before running any database script, back up your database first. 

 

DECLARE @IPrangeID int
DECLARE MY_CURSOR CURSOR
  LOCAL STATIC READ_ONLY FORWARD_ONLY
FOR
SELECT DISTINCT IprangeID
FROM tsysIPScanRanges
OPEN MY_CURSOR
FETCH NEXT FROM MY_CURSOR INTO @IPrangeID
WHILE @@FETCH_STATUS = 0
BEGIN
	update tsysipscanranges set
	Day1time = CONVERT(DATETIME, RAND())
	where iprangeID = @IPrangeID
    PRINT @IPrangeID
    FETCH NEXT FROM MY_CURSOR INTO @IPrangeID
END
CLOSE MY_CURSOR
DEALLOCATE MY_CURSOR
	update tsysipscanranges set
	Day2time = Day1time,
	Day3time = Day1time,
	Day4time = Day1time,
	Day5time = Day1time,
	Day6time = Day1time,
	Day7time = Day1time
update tsysupdate set IpScanRanges = getdate()

 

Your IP Range scanning targets will now be scheduled to run throughout the day for better organization and efficiency.


Was this post helpful? Leave a Kudo!
Did you have a similar issue and a different solution? Share your work in the comments below and help your fellow IT Hero's!
More questions? Browse our Quick Tech Solutions or Community Forum.

If you can't find what you're looking for, create a post in our Community Forum.




Was this post helpful? Leave a Kudo!
Did you have a similar issue and a different solution? Share your work in the comments below and help your fellow IT Hero's!
More questions? Browse our  Quick Tech Solutions  or  Community Forum.


If you can't find what you're looking for, create a post in our Community Forum.



3 Comments
rinks
Champion Sweeper

Where do we run scripts from? Within Lansweeper? From the Lansweeper server device? Any device with LsAgent installed through PowerShell? 

Mister_Nobody
Honored Sweeper II

You can run script in SQL Management Studio on lansweeperdb.

ErikT
Lansweeper Tech Support
Lansweeper Tech Support

@rinks 
If you do not have SQL Management Studio installed, you can execute this script with the Lansweeper SQL Maintenance tool. 

This is located on your scanning server. 
Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe

  • Open the tool
  • Select the Script Execution tab
  • Copy and paste the code 
  • Click Execute

ErikT_0-1698918151158.png

 

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now