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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wilkie1984
Engaged Sweeper II
Hi there,

I was wondering if there was a way in which we can monitor remote sites that are not connected to our main domain. They are just workgroups but i want to be able to bring in the full inventory for each of the workgroups across the country.

What is the best way to do this?

Thanks,
David
8 REPLIES 8
njett
Engaged Sweeper III
Another option which we are doing is to have the LSPUSH.exe file accessible via fileshare and create a Scheduled task that is pushed out via GPO. The convenience of running LSPUSH from the share is that it minimizes the number of places you need to update when the agent is updated.

Our scheduled task looks a lot like JMJE's except I run the task as NETWORK SERVICE and the fact that we run ours from a fileshare.

Of course if you're running this from PC's/laptops off the network/domain you may run into some issues.

jmje
Engaged Sweeper III
I created a scheduled task on my local machine as follows :
RUN AS : SYSTEM - whether user is logged in or not.

Triggers :
- daily at 9am.
- at system startup
Actions :
- Start a Program.
- c:\ProgramData\Lansweeper\lspush.exe
- Arguments : <Your LS Server>
Conditions :
- Wake computer to run this task.
- Removed all "only run on AC" type conditions.
Settings :
- allow to be run on demand. (important. I'll explain later.)
- Run as soon as possible after a scheduled start is missed.
- stop if it runs more than 1 hr.
- if it doesn't end when requested, force it to stop.


You have to have the LSPush.exe installed in the directory above for this to work.
Once you have it working on your local machine, export it into an XML file.

I use the following script to push the 2 files to a remote machine and install it.
You need this script, psexec, and a file called servers.txt in the same directory. I called this directory LSPUSH.
servers.txt contains a 1 per line list of your target machines.

You want a subdirectory off this folder called CLIENT, that contains lspush.exe, and the xml file from above. I called this Lansweeper.xml. I name any new version of the lspush client lspush.exe and drop it here. That way I don't have to modify the scripts. There is a txt file named after the current version in the clients directory as well.

The below copies the 2 files out. It deletes any task called lansweeper if it exists, then creates the task to run lspush, and finally runs it. I included the delete line in case I updated the xml file.



@echo off

set INSTALL_NAME=lspush.exe
set SERVER_NAME=<YOUR LS SERVER IP OR NAME GOES HERE>

for /F "usebackq delims==" %%I in ("servers.txt") do Call :begin %%I

goto :EOF

:begin
set srv=%1
:get info

mkdir \\%srv%\C$\ProgramData\Lansweeper\

robocopy \\<server>\C$\<path to script>\LSPush\Client \\%srv%\C$\ProgramData\Lansweeper\ %INSTALL_NAME% /r:0 /w:0
robocopy \\<server>\C$\<path to script>\LSPush\Client \\%srv%\C$\ProgramData\Lansweeper\ Lansweeper.xml /r:0 /w:0

psexec \\%srv% c:\windows\system32\SCHTASKS /Delete /TN Lansweeper /F
psexec \\%srv% c:\windows\system32\SCHTASKS /Create /XML "C:\ProgramData\Lansweeper\Lansweeper.xml" /TN Lansweeper
echo %srv% %errorlevel% >> results.txt
psexec \\%srv% c:\windows\system32\SCHTASKS /Run /TN Lansweeper

REM pause


The pause is in there in case I want to review the run 1 machine at a time. A file called results.txt will be created during the run, with standard windows error codes. 0 is good.

If you want to scan a machine remotely with this, and you're getting errors from the web client, you can run this for machines with the scheduled task above installed (note the text file "servers - scan.txt" for this one.) :
(this is why we set it to be run on demand.)


@echo off

set INSTALL_NAME=lspush.exe
set SERVER_NAME=<YOUR LS SERVER IP OR NAME GOES HERE>


for /F "usebackq delims==" %%I in ("servers - scan.txt") do Call :begin %%I

goto :EOF

:begin
set srv=%1
:get info

echo.
echo %srv%
schtasks /run /s %srv% /tn Lansweeper
echo.

pause



If you update lansweeper, and want to update the LSPUSH file for the clients, just run this one. (from the same dir you created on your server above, with the psexec, etc in it.


@echo off

set INSTALL_NAME=lspush.exe
set SERVER_NAME=<YOUR LS SERVER IP OR NAME GOES HERE>

for /F "usebackq delims==" %%I in ("server_update.txt") do Call :begin %%I

goto :EOF


:begin
set srv=%1
:get info

xcopy \\detv-lswp\C$\Scripts\Custom\LSPush\Client\%INSTALL_NAME% \\%srv%\c$\ProgramData\Lansweeper\ /E /Y

psexec \\%srv% c:\windows\system32\SCHTASKS /Run /TN Lansweeper

REM pause




You can create a report under file and registry scanning to look for the following to find out which machines have this installed. This report shows file version for me.

C:\ProgramData\Lansweeper\Lspush.exe

This DOES NOT WORK FOR XP or 2003 series machines. They did task scheduling differently.

I run this from an elevated command prompt on the server, with my domain admin ID currently logged in as the user to the server. It sometimes fails on a non-elevated prompt.

Questions, let me know.
wilkie1984
Engaged Sweeper II
Hi Jmje,

Do you have full instructions on how to do this?

Also I have the VPN's configured but it never brings in the computers. Does anyone have any other ideas of how I can solve this?

Thanks
David
jmje
Engaged Sweeper III
You can set up LSPush to work off a scheduled task. We're doing that for our sites.

Basically, LSpush fires off at 10am, or shortly after a user logs in.
For recent versions of windows, you can create the Task on your local machine, and export it as an xml file.

Import this into the machines you need scanned. Make sure that LSPush is in the same directory on those machines as it is on yours. We use c:\programdata\lansweeper These machines should be able to see the Lansweeper server via a tunnel of some kind.
The task needs to run as the local system account.

Done. Automated.
fjca
Champion Sweeper II
If you have a VPN, why not do a IP Range scan ?

Do a target scanning object with all of your "possible" IPs, adjust the schedule to your needs, it defaults to every day, but you can set it up every minute (although I would not recommended it), I would say every hour or so, and that's for very intermittent connected machines ...
wilkie1984
Engaged Sweeper II
Hi Bruce i have seen the LSPush and it does work but i was trying to stay away from having to manually do this as much as possible, if i can get it working automatically through my point to point vpn then that is my preferred way of doing it.

I do have VPN's setup between the sites but i still cant pull in the data, does anyone have any idea?

Thanks,
David
Bruce_B
Lansweeper Alumni
You could use the LsPush scanning agent to inventory computers that are not in the same network as your Lansweeper server. LsPush scanning data can be written to a file, which can then be imported to your Lansweeper server. The usage of LsPush is explained in this article.

Since you're planning to scan workgroup computers, it's important to note that Lansweeper uniquely identifies Windows computers based on a combination of Domain name and computer name as explained in this article. This works very well in a domain setting as no 2 computers with the same computer name can exist. In a workgroup environment there's no such restriction though. Do make sure that all the workgroup computers you scan have unique names, as otherwise they will overwrite each other.
AZHockeyNut
Champion Sweeper III
if they are not connected that might be tough. I have a remote site I scan but it has a point to point vpn tunnel and the scanning server has a route to that lan.