
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2019 04:48 PM
Solved! Go to Solution.
- Labels:
-
General Discussion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 08:01 AM
- Do we have flying cars yet?
- I don't recommend using ForceScan=1 to force LsAgent scans, as this will result in an LsAgent scan being performed at every "check interval", i.e. 15 minutes. Clearing the LastScan and LastSent values and restarting the service is the superior option, as this will trigger just a single scan and afterwards the asset will follow its schedule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2021 02:06 PM
The code below changes the timestamp to be 90 days prior from the original date on the file. It likely does not need to be that long.
Stop-Service LansweeperAgentService
Start-Sleep -s 5
$(Get-Item "C:\Program Files (x86)\LansweeperAgent\LsAgent.ini").lastwritetime=$(Get-Date).adddays(-90)
Start-Service LansweeperAgentService

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 09:58 AM - edited ‎07-27-2023 10:03 AM
Doesn't work for me thus i made a PS script to replace two strings in .ini file with blank value...
Stop-Service LansweeperAgentService
Start-Sleep -s 5
$file = 'C:\Program Files (x86)\LansweeperAgent\LsAgent.ini'
$regex = 'LastScan.*'
(Get-Content $file) -replace $regex, 'LastScan=' | Set-Content $file
$regex = 'LastSent.*'
(Get-Content $file) -replace $regex, 'LastSent=' | Set-Content $file
Start-Service LansweeperAgentService

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2021 05:46 PM
David Cocke wrote:
Is there a way to force an inventory scan when using the Lansweeper Agent? I found where you can adjust the polling schedule, but sometimes we're making changes on an endpoint and would like for those changes to appear right away instead of waiting until the next polling period.
This is the ansible play (lansweeper-rescan.yml) we use to force a rescan:
---
- hosts: windows
gather_facts: no
tasks:
- name: "Stop LansweeperAgent"
win_service:
name: LansweeperAgentService
state: stopped
- name: "Remove timestamps from LsAgent.ini"
win_lineinfile:
path: C:\Program Files (x86)\LansweeperAgent\LsAgent.ini
regex: ^Last
state: absent
- name: "Start LansweeperAgent"
win_service:
name: LansweeperAgentService
state: started

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 03:04 PM
[default]
Server=192.168.11.33
Port=9524
AgentKey=
Enabled=1
AssetId=
ComputerName=
LastScan=
LastSent=
Status=Running
Version=7.1.110.2
Please advise if this is not a good option. Does it create duplicate assets?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 08:01 AM
- Do we have flying cars yet?
- I don't recommend using ForceScan=1 to force LsAgent scans, as this will result in an LsAgent scan being performed at every "check interval", i.e. 15 minutes. Clearing the LastScan and LastSent values and restarting the service is the superior option, as this will trigger just a single scan and afterwards the asset will follow its schedule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 05:20 PM
If you want to force an immediate LsAgent scan, you can clear LastSent/LastScan or add a ForceScan=1 entry to LsAgent.ini and restart the service.
You'll still be dependent on the interval at which Lansweeper pulls data from the cloud relay if you are using that.
