Use the IT Agent Discovery to identify and track assets that connect to your network. You can install it interactively or silently, depending on your deployment needs.
Learn this in the Academy
Rolling out the IT Agent at scale? The free Lansweeper Discovery: Operate & optimize learning path in the Lansweeper Customer Academy includes a module on silently installing the IT Agent with a script.
Prerequisites
- Review the IT Agent requirements.
- Confirm the target computer runs a supported operating system.
Supported operating systems
- Windows 7 SP1 or Windows 8.1, with Extended Security Updates (x64)
- Windows 10, version 1607 or higher (x64)
- Windows 11, version 22000 or higher (x64)
- Windows Server 2012 or higher (Core and Desktop Experience, x64)
Install the agent
Ideal for most users when installing on a few devices.
In your preferred site, go to Discovery > Systems > Download installers/packages > IT Agent Discovery.
Find the exe format and select Download IT Agent installer.
Run the downloaded installer.
When prompted, select Yes to allow the app to make changes to your device.
Read and select I accept the agreement.
Choose the installation directory and select Next.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
Paste the copied linking code into the installer and select Next.
Select Next again to start the installation.
Ideal for repeatable deployments across devices.
In your preferred site, go to Discovery > Systems > Download installers/packages > IT Agent Discovery.
Find the exe format and select Download IT Agent installer and Download IT Agent silent installation configuration.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
On your Windows computer, open the downloaded
lansweeperitagentinstallation.cfgfile.Replace
cloudtokenvaluewith your copied linking code. If needed, configure proxy settings by removing the#symbols.mode=unattended accepteula=1 path=C:\Program Files\Lansweeper IT Agent Discovery cloudtoken=cloudtokenvalue #proxyserver=myproxyserver.domain.local #proxyport=8080Open an elevated Command Prompt and run the following command, replacing
X.X.Xwith the installer version number:Installer version
The version numbers for your installer can be found in your Lansweeper site. Go to Discovery > Download installers/packages > IT Agent Discovery > Version and locate your installer.
Lansweeper-IT-agent-discovery-X.X.X-windows-x64-installer.exe --optionfile lansweeperitagentinstallation.cfg
Ideal for scripted installs without editing a .cfg .
In your preferred site, go to Discovery > Systems > Download installers/packages > IT Agent Discovery.
Find the exe format and select Download IT Agent installer.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
Run this command in an elevated Command Prompt, replacing
cloudtokenvaluewith your copied linking code andX.X.Xwith the installer version:Installer version
The version numbers for your installer can be found in your Lansweeper site. Go to Discovery > Download installers/packages > IT Agent Discovery > Version and locate your installer.
Lansweeper-IT-agent-discovery-X.X.X-windows-x64-installer.exe --mode unattended --accepteula 1 --path "C:\Program Files\Lansweeper IT Agent Discovery" --cloudtoken cloudtokenvalueProxy parameters
To use a proxy, add the parameters
--proxyserver proxyserveraddressand--proxyport.
Ideal for large-scale or centrally managed environments that rely on enterprise software distribution.
In your preferred site, go to Discovery > Systems > Download installers/packages > IT Agent Discovery.
Find the msi format and select Download IT Agent installer.
In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
Run this command in an elevated Command Prompt, replacing
cloudtokenvaluewith your copied linking code andX.X.Xwith the installer version:Installer version
The version numbers for your installer can be found in your Lansweeper site. Go to Discovery > Download installers/packages > IT Agent Discovery > Version and locate your installer.
msiexec /i "C:\Path\To\Lansweeper-IT-agent-discovery-X.X.X-windows-x64-installer.msi" /quiet ARGUMENTS="--mode unattended --accepteula 1 --cloudtoken cloudtokenvalue"Proxy parameters
To use a proxy, add the parameters
--proxyserver proxyserveraddressand--proxyport.
Ideal for automated, hands-off deployment that downloads the latest installer.
Copy the following script:
# ============================================== # Lansweeper IT Agent Discovery Silent Installer # ============================================== # --- 1. Set Cloud Token Variable --- $CloudToken = "cloudtokenvalue" # Replace with your linking code # --- 2. Require TLS 1.2 for Downloads --- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # --- 3. Define Download URLs --- $InstallerUrl = "https://download.lansweeper.com/stable/windows/it-agent-discovery/latest" $ConfigUrl = "https://download.lansweeper.com/stable/windows/lansweeper-it-agent-installation-config-stable/latest" # --- 4. Define Local File Paths --- $TempFolder = "$env:TEMP\LansweeperInstaller" $InstallerExe = "$TempFolder\Lansweeper-IT-Agent-Discovery-Installer.exe" $ConfigFile = "$TempFolder\install_config.cfg" # --- 5. Prepare Temp Folder --- if (Test-Path $TempFolder) { Remove-Item -Recurse -Force $TempFolder } New-Item -ItemType Directory -Path $TempFolder | Out-Null # --- 6. Download Installer and Config --- Write-Host "Downloading Lansweeper IT Agent Discovery installer..." Invoke-WebRequest -Uri $InstallerUrl -OutFile $InstallerExe -UseBasicParsing Write-Host "Downloading Lansweeper config file..." Invoke-WebRequest -Uri $ConfigUrl -OutFile $ConfigFile -UseBasicParsing # --- 7. Insert Cloud Token into Config --- Write-Host "Updating config file with cloud token..." (Get-Content $ConfigFile) -replace "cloudtokenvalue", $CloudToken | Set-Content $ConfigFile -Encoding UTF8 # --- 8. Run Silent Install with Config --- Write-Host "Running silent installation..." Start-Process -FilePath $InstallerExe -ArgumentList "--mode unattended --optionfile `"$ConfigFile`"" -Wait -NoNewWindow # --- 9. Clean Up Temp Folder --- if (Test-Path $TempFolder) { Remove-Item -Recurse -Force $TempFolder Write-Host "Temporary files removed." } Write-Host "Lansweeper IT Agent Discovery installation completed."In your site, select Systems > Link discovery system > Create new code. Specify an expiration date, then select Apply and copy the generated code.
In the first section of the script, replace
cloudtokenvaluewith your copied linking code.Save your file as a PowerShell script, for example
Install-LSITAgent.ps1.Run the PowerShell script with administrative privileges.
Troubleshooting
Installation fails with "Could not start Lansweeper IT Agent Discovery Hub Service"
The full message reads: "Could not start Lansweeper IT Agent Discovery Hub Service. The application will exit now." This can happen on machines with a slow hard disk, low memory, or limited CPU resources. To resolve it during installation:
- Press Windows + R to open Run.
- Enter
regeditto open the Registry Editor. - Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control. - In the Control folder, create a new DWORD (32-bit) value named
ServicesPipeTimeout. - Open the value, set Base to Decimal, and enter
600000in Value data. - Select OK.
- Restart your system. The change doesn't apply until you restart.
- Run the IT Agent installer again.
Installation fails with "Unable to initialize installer"
This error occurs when the TMP or TEMP environment variable points to a path that doesn't exist. To fix it:
- Press Windows + R to open Run.
- Enter
sysdm.cpland press Enter to open System Properties. - In the Advanced tab, select Environment Variables.
- Find TMP or TEMP under User variables or System variables.
- Select the variable and select Edit.
- Set Variable value to a valid folder path, such as
C:\Windows\Temp. - Select OK to save your changes.
- Run the installer again.
The installation log tells me to check TLS 1.2, internet access, or my linking code
Confirm the device can use curl to make outbound connections to the URLs required for IT Agent Discovery. Also confirm Microsoft Defender or Attack Surface Reduction rules aren't blocking C:\Program Files\Lansweeper IT Agent Discovery\resources\curl.exe.
The install keeps failing because of a previous corrupt install
Download the latest Windows installer from your Lansweeper Site (Discovery > Systems > Download installers/packages), then save the following as ITAgentCleanup.bat:
@echo off
:: BatchGotAdminREM --> Check for permissions
nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:: --------------------------------------
:: Uninstall Lansweeper IT Agent
"C:\Program Files\Lansweeper IT Agent Discovery\uninstall.exe" --mode unattended
:: Sleep for x seconds to continue
TIMEOUT /T 300
:: Ensure lingering services are stopped and removed
sc stop "Lansweeper IT Agent Discovery Hub Service"
sc delete "Lansweeper IT Agent Discovery Hub Service"
sc stop "Lansweeper IT Agent Discovery Sensor Service"
sc delete "Lansweeper IT Agent Discovery Sensor Service"
sc stop "Lansweeper IT Agent Discovery Update Service"
sc delete "Lansweeper IT Agent Discovery Update Service"
:: Sleep for x seconds to continue
TIMEOUT /T 60
:: Delete default install directory
del /S "C:\Program Files\Lansweeper IT Agent Discovery*"
:: Cleanup first reg location
for /f "delims=" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Lansweeper" ^| find "Lansweeper IT Agent Discovery"') do (set "regs=%%a")
echo %regs%
reg delete "%regs%" /f
:: Cleanup second reg location
for /f "delims=" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ^| find "Lansweeper IT Agent Discovery"') do (set "regs=%%a")
echo %regs%
reg delete "%regs%" /f
:: Reinstall Lansweeper IT Agent
:: Update the path below to your installer's location and the cloudtoken value from your Lansweeper Site (Discovery > Systems > Link discovery system). Then uncomment the last line and run this file.
:: C:\Temp\Lansweeper-IT-agent-discovery-0.23.2-windows-x64-installer.exe --mode unattended --accepteula 1 --path "C:\Program Files\Lansweeper IT Agent Discovery" --cloudtoken cloudtokenvalue
Edit the last line in a text editor and run it on your computer.
Next steps
Now that your IT Agent is installed, you can create a discovery action to specify when discovery should occur.