Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
OrthodoxyUSA
Engaged Sweeper
Hi guys... I've seen this question posted many times.

"How do I push a re-scan of everything in the Lansweeper database "Now" ?"

So... here is my solution.

If you want to scan every computer (lstrigger.exe) all the computers currently in the Lansweeper database, copy this text into a .cmd or .bat file, make the needed modifications for your {server}, {database} and {Lansweeper Server IP} and run it.


@echo off
del %TEMP%\computers.txt
del %TEMP%\output.txt

osql -E -S {server} -d {database} -n -s , -Q "select RTRIM(Computername)+ ','+RTRIM(Domain) from tblComputers" >>%TEMP%\computers.txt

FOR /f "EOL=( skip=18 TOKENS=1-2" %%L in (%TEMP%\computers.txt) DO (
ECHO %%L %%M>>%TEMP%\output.txt
)

del %TEMP%\computers.txt

FOR /f "delims=, TOKENS=1-2" %%L in (%TEMP%\output.txt) DO (
lstrigger.exe {LansweeperServer IP} %%L %%M
)

del %TEMP%\output.txt


As a further example, mine looks like this...

@echo off
del %TEMP%\computers.txt
del %TEMP%\output.txt

osql -E -S CISNG5\SQLEXPRESS -d lansweeperdb -n -s , -Q "select RTRIM(Computername)+ ','+RTRIM(Domain) from tblComputers" >>%TEMP%\computers.txt

FOR /f "EOL=( skip=18 TOKENS=1-2" %%L in (%TEMP%\computers.txt) DO (
ECHO %%L %%M>>%TEMP%\output.txt
)

del %TEMP%\computers.txt

FOR /f "delims=, TOKENS=1-2" %%L in (%TEMP%\output.txt) DO (
lstrigger.exe 10.1.150.247 %%L %%M
)

del %TEMP%\output.txt


Happy scanning!

Paul
2 REPLIES 2
Hemoco
Lansweeper Alumni
Next version will contain a commandline tool: lsscanad.exe
Parameters = "ou to scan" will scan recursively so you scan scan your entire domain
/rescan : same results as lstrigger.
weldridge
Engaged Sweeper
Paul,
Thanks for this post. I too have been trying to find out the best way to do an immediate scan and being new to this application, I have a lot to learn.

Wayne

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

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

Try Now