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