‎03-12-2019 04:48 PM
Solved! Go to Solution.
‎06-07-2019 08:01 AM
‎05-05-2021 02:06 PM
Stop-Service LansweeperAgentService
Start-Sleep -s 5
$(Get-Item "C:\Program Files (x86)\LansweeperAgent\LsAgent.ini").lastwritetime=$(Get-Date).adddays(-90)
Start-Service LansweeperAgentService
‎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
‎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.
---
- 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
‎08-28-2019 03:04 PM
‎06-07-2019 08:01 AM
‎03-13-2019 05:20 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now