![Pro-Tips-with-Esben-10-LsAgent-with-Intune](https://cdn-website.lansweeper.com/wp-content/uploads/Pro-Tips-with-Esben-10-LsAgent-with-Intune.png)
Pro Tips with Esben #10
This week I have something special, my first guest post. Our very own Sysadmin at Lansweeper approached me to use this platform to share how he uses Intune to deploy LsAgent in our own environment. If you’re starting out with Intune or haven’t used it yet for the deployment of LsAgent this should be of great value to you!
LsAgent – What is it?
Since most of you will already have some idea of what LsAgent is, I won’t drag this out. LsAgent is our scanning agent that can scan Windows, Linux, and Mac devices both locally (via a direct connection) or remotely (via our cloud relay server). If you’re not familiar yet with LsAgent I recommend growing through the LsAgent documentation.
Preparing LsAgent for Deployment
In a large environment, you don’t want to ask every user to manually install LsAgent, it wouldn’t even be possible if the appropriate security measures are taken and your users don’t have admin privileges.
To achieve this we will add LsAgent as a Win32 app to Microsoft Intune, before you can do that you must prepare the app by using the Microsoft Win32 Content Prep Tool. This tool converts application installation files into the .intunewin format.
Before you get started:
- Download the IntuneWinAppUtil.exe
- Download the LsAgent client for Windows from this download page.
- It’s recommended that you update your Lansweeper installation to the latest version.
- In Lansweeper, copy the relay authentication key listed under ScanningCloud Relay Configuration
- Copy the IP Address or DNS Name from your Lansweeper scanning server
Step 1 – Creating the .intunewin file
The first step in creating our .intunewin file is to create a temporary folder, I’ll create C:Temp and place both LsAgent-windows.exe & IntuneWinAppUtil.exe in it.
![image 20211109 134539](https://cdn-website.lansweeper.com/wp-content/uploads/2021/11/image-20211109-134539.png)
Next, Open CMD as an administrator and run IntuneWinAppUtil.exe, now fill in the required parameters to create the .intunewin file.
![image 20221206 085857](https://cdn-website.lansweeper.com/wp-content/uploads/2021/11/image-20221206-085857.png)
Step 2 – Upload the installation file in .intunewin
To upload your install file, open your Microsoft Endpoint Manager admin center and upload the .intunewin file as a Win32-based app.
![deploy LsAgent with Intune 3](https://cdn-website.lansweeper.com/wp-content/uploads/deploy-LsAgent-with-Intune-3-1024x97.png)
Step 3 – App configuration
Once your file has been uploaded to Microsoft Endpoint Manager, make sure to fill in the app information.
![deploy LsAgent with Intune 4](https://cdn-website.lansweeper.com/wp-content/uploads/2021/11/deploy-LsAgent-with-Intune-4.png)
Next, we need to specify the commands to install and uninstall this app:
- Install command = LsAgent-windows.exe –server LAN-001 –port 9524 –agentkey 4c2db649-014a-41f5-a01d-08950d7af –mode unattended
- Uninstall command = „C:\Program Files (x86)\LansweeperAgent\uninstall.exe“ –mode unattended
![deploy LsAgent with Intune 5](https://cdn-website.lansweeper.com/wp-content/uploads/2021/11/deploy-LsAgent-with-Intune-5.png)
If you’re interested in customizing the install or uninstall command, we’ve got LsAgent parameters knowledgebase article with all parameters you can use.
The next step in our setup is to fill in the requirements, depending on which machines you want to deploy LsAgent on, you can obviously adjust this to your needs.
![deploy LsAgent with Intune 6](https://cdn-website.lansweeper.com/wp-content/uploads/2021/11/deploy-LsAgent-with-Intune-6.png)
Once the requirements are set and configured how you need them, we can create the detection rule.
![deploy LsAgent with Intune 7](https://cdn-website.lansweeper.com/wp-content/uploads/deploy-LsAgent-with-Intune-7-1024x137.png)
We won’t be using Dependencies & Supersedence, so all that is left now is to assign the app to your users or devices. And that’s It! Everything you need to know to successfully deploy LsAgent using Intune.
Once your deployments have finished, you can also take a look a the LsAgent version report to get an overview of all your assets and the LsAgent version they are using.