Ok I figured out a nice easy way to do the scanning via schtasks for multiple computers without aload of hassle. Maybe I will try and write a web interface for this so its even easier...
Here is how i did it. For anyone else who ever comes accross this thread you might need to adapt the instructions.
Create a file called PCList.txt and place it in the root of the c:\ drive of the lansweeper machine. (In my case both MSSQL and Lsconsole run on the same machine but if you have a database server and lsconsole server run this from the machine hosting lsconsole).
Create a share called "bat" and place the following files in it:
(lansweeper.bat)
--------------------------------------------------------------------
echo Running PC Audit
\\servername\bat\lsclient.exe <lansweeper IP>
--------------------------------------------------------------------
This bat file contains the same info you would run from a logon script.
(l.bat)
--------------------------------------------------------------------
@Echo Off
for /F %%I in (c:\PCList.txt) do call startsweep.bat %%I
--------------------------------------------------------------------
(startsweep.bat)
--------------------------------------------------------------------
@echo off
set thisPC=%1
echo checking %thisPC%
schtasks /create /s %thisPC% /tr \\servername\bat\lansweeper.bat /sc once /st 14:15:01 /sd 04/07/2006 /tn RunPCAudit /ru DOMAINNAMEHERE\lsuser /rp LSUSERPASSHERE
--------------------------------------------------------------------
Then you should load up a command prompt, navigate using CD to the directory where the bat share is and type in "l"
This will then run the file l.bat which lists all the PCs from PCList.txt
Then it wil run startsweep.bat which runs the schtask command but picks up the PC names from PCList.txt
You should see an output similar to the below:
checking PCNAME
SUCCESS: The scheduled task "RunPCAudit" has successfully been created.
checking PCNAME2
SUCCESS: The scheduled task "RunPCAudit" has successfully been created.
checking PCNAME3
SUCCESS: The scheduled task "RunPCAudit" has successfully been created.
checking PCNAME4
ERROR: The network path was not found.
Note on this example PCNAME4 was turned off so the network path is not found. At the end of all this review the list for any PCs not found and then you can contact the users to reboot or try again another time.
Hope this helps someone!!
Of course some bits you will need to modify to reflect your organisation. Remeber to change things like the date and time in the task command
😉Also do a test first with a few PCs. I found its good to allow around 40-60 seconds per machine when running the task. Maybe the PC timeout values can be changed but im not sure how.
🙂 🙂
{George}