cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
name_not_found
Engaged Sweeper II

Hello all,

I wanted to ask if anyone knew of a way to initiate a scan from the host asset from the command line.

We are trying to get a startup script built out that will begin a scan when a user signs in.

I know there is the Active Directory Domain Scanning Method that is available and we are currently using it but I was asked to see if I could specifically get it to run through a startup script.

I appreciate any feedback on this!

2 ACCEPTED SOLUTIONS
RolandB
Engaged Sweeper III

I use it myself.  Have a User GPO -- lspuh and a AutoIT script (EXE) is save in our DC netlogon folder ...  have create a AutoIT script with intelligence for starting the lspush to separate Lansweeper scan server.... the AutoIT script is running behind and the user can see this in the windows tray...  we starting all startup scripts on Windows 5min later this is also a GPO from Windows self

View solution in original post

RolandB
Engaged Sweeper III

you can also run a simple cmd from netlogon folder

with \\server\netlogon\... lspush.exe lansweeperserver
we starting this all with a GPO ... 5 min later starting startup script

View solution in original post

5 REPLIES 5
RolandB
Engaged Sweeper III

I use it myself.  Have a User GPO -- lspuh and a AutoIT script (EXE) is save in our DC netlogon folder ...  have create a AutoIT script with intelligence for starting the lspush to separate Lansweeper scan server.... the AutoIT script is running behind and the user can see this in the windows tray...  we starting all startup scripts on Windows 5min later this is also a GPO from Windows self

Appreciate that Roland. I started moving in that direction once I found the KB Article.

I've got the lspush agent delivered via GPO and built out a Powershell script with some logging features commented out for long term management.

<#
General Information
    The Lspush.exe must be updated when the Lansweeper application is updated. 

Knowledge Base Article on implementing lspush through Group Policy.
    https://community.lansweeper.com/t5/scanning-your-network/scan-windows-computers-with-lspush-in-a-group-policy/ta-p/64434

Knowledge Base Article on the different switches for lspush and an explaination of how they function.
    https://community.lansweeper.com/t5/scanning-your-network/introduction-to-the-lspush-scanning-agent-for-windows/ta-p/64277
#>

# Server is listed out with the FQDN for consistency. Update as needed.
$Server = "Lansweeper"
$lsPushPath = "C:\Temp\lspush.exe"

# Begins the lspush scan and sends the information to the Lansweeper server. 
Start-Process $lsPushPath -ArgumentList $Server

# Text file for debugging and logging. 
New-Item -Path C:\Temp\Lansweeperscan.txt -Value "Lansweeper script ran to completion. Last good run time was $(Get-Date)" -Force

This is functioning correctly for now. I'm going to go back and add some more later to check if a user is on VPN.

RolandB
Engaged Sweeper III

you can also run a simple cmd from netlogon folder

with \\server\netlogon\... lspush.exe lansweeperserver
we starting this all with a GPO ... 5 min later starting startup script

name_not_found
Engaged Sweeper II

Answering my own question.

It looks like there is a executable that can be found on the server that can be used to initiate a scan from command line. KB Here.

Has anyone had any experience using this before?

Do you use something like a batch script when users log into their computers?

 

If so, there is an easy one line command you should be able to add to it