‎09-04-2024 09:23 PM - last edited on ‎09-12-2024 06:05 PM by Mercedes_O
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!
Solved! Go to Solution.
‎09-05-2024 08:17 AM
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
‎09-05-2024 08:27 AM
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
‎09-05-2024 08:17 AM
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
‎09-05-2024 04:10 PM
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.
‎09-05-2024 08:27 AM
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
‎09-04-2024 09:54 PM
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?
‎09-05-2024 03:53 AM
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
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now