- Home
- Solutions
- Zluri Agents
- How to update and install the Zluri Agent using MS Intune
How to update and install the Zluri Agent using MS Intune
Windows Versions tested on : WIndows 11, Windows 10
Login to your MS Intune
SETTING UP THE APPLICATION INSTALLATION
Go to Apps, All Apps
2. Click on Add.
3. From the Select App blade choose the Windows app(Win 32) from the drop-down menuClick on the Select button at the bottom of the blade.
Click on “Select app package file” , Add the intunewin file and click on OK.
+
Fill in the basic details of the application, click on next.
Change the Install behaviour to “User”
Device Restart Behaviour to “No Specific Action”
Click on Next.
Operating System Architecture: Select both 32 Bit and 64 Bit
Minimum OS: The first Option present
Configure additional requirement rules
On the side sheet:
Rule Type: File
Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\
File or Folder: zluri.exe
Detection method: File or folder does not exists
Click on OK
Click on next
Rules configure:”Manually configure detection rules”
On the side sheet:
Rule Type: File
Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\
File or Folder: zluri.exe
Detection method: File or folder exists
Click on Ok
Click on next
Click next for dependencies
Click next for Supersedence
In assignments, choose the same devices/users/ groups that was chosen for the script, and click on next.
Click on Next, Click on create
Why configuring Configure additional requirement rules?
Whenever zluri is already present in any system irrespective of the version, this fails the app deployment.
SETTING UP THE SCRIPTS
Navigate to Devices, and search for Scripts
Click on Add
Choose Windows or Later
Add the basic Details like name and description
Name: Zluri script
Description: Zluri script for agent installation
In the “Script settings”
Add the script file,
Run this script using the logged on credentials: Yes
Enforce script signature check: No
Run script in 64 bit PowerShell Host: Yes
Click on “Next”
Assign it to a group/all devices/ all users based on how this is being deployed, click on Next
Click on add
Script:
Find the script here:https://github.com/ZluriHQ/agents-scripts/blob/main/scripts/windows/intune/v1/zluri-windows-config-intune.ps1
NOTE:
Replace your organisation token in place of <orgToken> in the below script. This makes the agent automatically try authentication using orgToken.
The requests from the devices can be found in the Zluri dashboard under Source > Agents > Desktop Agents
Map the users to devices to make the agent logIn completely
Save the file with an extension: .ps1
Example: windowsScript.ps1
#expected version. zluri apps lesser than this version will get uninstalled.
$expectedVersion="3.3.0.0"
#Values to insert into client-config.json file
$configValues='{"org_token": "<orgToken>","interval": "3600000","local_server":"on"}'
#########################################################################################
# Path for zluri script logs
$logPathRoot=$env:programdata
If (-not (Test-Path "$logPathRoot\zluri")) {
Log-Message "Creating zluri folder in $folderPath"
New-Item -Path "$logPathRoot\zluri" -ItemType "directory"
}
# Logger function
Function Log-Message([String]$Message)
{
Add-Content -Path "$logPathRoot\zluri\zluriscriptlog.txt" $Message
}
# Specify the expected version in the same format
$logDate=Get-date
Log-Message "$logDate"
# Get the installed zluri apps
$isZluriApp=Get-WmiObject -Class Win32_Product | where name -eq zluri
Log-Message "$isZluriApp"
# For each zluri agent present in the system
foreach($zluriApp in $isZluriApp){
Log-Message "$zluriApp"
$currentVersion=$zluriApp.version
# Check if expected version is greater than the installed zluri version
if($expectedVersion -gt $currentVersion){
Log-Message "checking if $expectedVersion greater than $currentVersion"
$zluriProcess=Get-Process -Name "zluri"
# stopping all zluri process
Log-Message "$zluriProcess"
$nid = (Get-Process zluri).id
Stop-Process -Id $nid -Force
Wait-Process -Id $nid -ErrorAction SilentlyContinue
# Uninstalling zluri app
$zluriApp.uninstall() | Out-Null
# deleting zluri folder from %localappdata%\programs
Remove-Item C:\Users\$env:username\AppData\Local\Programs\zluri -Recurse -Force -ErrorAction silentlycontinue
Remove-Item C:\Users\$env:username\AppData\Roaming\zluri -Recurse -Force -ErrorAction silentlycontinue
# deleting the shortcut on desktop
$ShortcutsToDelete = Get-ChildItem -Path "C:\Users\$env:username\Desktop" -Filter "zluri.lnk"
$ShortcutsToDelete | ForEach-Object {
Remove-Item -Path $_.FullName
}
}
}
# function to create client-config.json file
function zluriClientConfigFiles{
# reading param
Param([String]$configFolderPath)
# Setting variable for folder path & file path
$folderPath = $("$configFolderPath\zluri")
$filePath=$("$folderPath\client-config.json")
# If there is no folderPath then create a zluri folder in that specific location
If (-not (Test-Path $folderPath)) {
Log-Message "Creating zluri folder in $folderPath"
New-Item -Path $folderPath -ItemType "directory"
}
# If there is a client-config.json file in the filepath remove the file
If (Test-Path $filePath) {
Log-Message "deleting existing $filePath"
Remove-Item $filePath
}
# Create client-config.json file in the filepath & insert the values
New-Item -Path $filePath -ItemType "file" -value $configValues
Log-Message "Created client config file in $filePath"
}
# Calling the function to create client-config.json file in programdata
zluriClientConfigFiles -configFolderPath $env:programdata
# Calling the function to create client-config.json file in localappdata
zluriClientConfigFiles -configFolderPath $env:localappdata
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article
Windows Versions tested on : WIndows 11, Windows 10
Login to your MS Intune
SETTING UP THE APPLICATION INSTALLATION
Go to Apps, All Apps
2. Click on Add.
3. From the Select App blade choose the Windows app(Win 32) from the drop-down menuClick on the Select button at the bottom of the blade.
Click on “Select app package file” , Add the intunewin file and click on OK.
+
Fill in the basic details of the application, click on next.
Change the Install behaviour to “User”
Device Restart Behaviour to “No Specific Action”
Click on Next.
Operating System Architecture: Select both 32 Bit and 64 Bit
Minimum OS: The first Option present
Configure additional requirement rules
On the side sheet:
Rule Type: File
Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\
File or Folder: zluri.exe
Detection method: File or folder does not exists
Click on OK
Click on next
Rules configure:”Manually configure detection rules”
On the side sheet:
Rule Type: File
Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\
File or Folder: zluri.exe
Detection method: File or folder exists
Click on Ok
Click on next
Click next for dependencies
Click next for Supersedence
In assignments, choose the same devices/users/ groups that was chosen for the script, and click on next.
Click on Next, Click on create
Why configuring Configure additional requirement rules?
Whenever zluri is already present in any system irrespective of the version, this fails the app deployment.
SETTING UP THE SCRIPTS
Navigate to Devices, and search for Scripts
Click on Add
Choose Windows or Later
Add the basic Details like name and description
Name: Zluri script
Description: Zluri script for agent installation
In the “Script settings”
Add the script file,
Run this script using the logged on credentials: Yes
Enforce script signature check: No
Run script in 64 bit PowerShell Host: Yes
Click on “Next”
Assign it to a group/all devices/ all users based on how this is being deployed, click on Next
Click on add
Script:
Find the script here:https://github.com/ZluriHQ/agents-scripts/blob/main/scripts/windows/intune/v1/zluri-windows-config-intune.ps1
NOTE:
Replace your organisation token in place of <orgToken> in the below script. This makes the agent automatically try authentication using orgToken.
The requests from the devices can be found in the Zluri dashboard under Source > Agents > Desktop Agents
Map the users to devices to make the agent logIn completely
Save the file with an extension: .ps1
Example: windowsScript.ps1
#expected version. zluri apps lesser than this version will get uninstalled.
$expectedVersion="3.3.0.0"
#Values to insert into client-config.json file
$configValues='{"org_token": "<orgToken>","interval": "3600000","local_server":"on"}'
#########################################################################################
# Path for zluri script logs
$logPathRoot=$env:programdata
If (-not (Test-Path "$logPathRoot\zluri")) {
Log-Message "Creating zluri folder in $folderPath"
New-Item -Path "$logPathRoot\zluri" -ItemType "directory"
}
# Logger function
Function Log-Message([String]$Message)
{
Add-Content -Path "$logPathRoot\zluri\zluriscriptlog.txt" $Message
}
# Specify the expected version in the same format
$logDate=Get-date
Log-Message "$logDate"
# Get the installed zluri apps
$isZluriApp=Get-WmiObject -Class Win32_Product | where name -eq zluri
Log-Message "$isZluriApp"
# For each zluri agent present in the system
foreach($zluriApp in $isZluriApp){
Log-Message "$zluriApp"
$currentVersion=$zluriApp.version
# Check if expected version is greater than the installed zluri version
if($expectedVersion -gt $currentVersion){
Log-Message "checking if $expectedVersion greater than $currentVersion"
$zluriProcess=Get-Process -Name "zluri"
# stopping all zluri process
Log-Message "$zluriProcess"
$nid = (Get-Process zluri).id
Stop-Process -Id $nid -Force
Wait-Process -Id $nid -ErrorAction SilentlyContinue
# Uninstalling zluri app
$zluriApp.uninstall() | Out-Null
# deleting zluri folder from %localappdata%\programs
Remove-Item C:\Users\$env:username\AppData\Local\Programs\zluri -Recurse -Force -ErrorAction silentlycontinue
Remove-Item C:\Users\$env:username\AppData\Roaming\zluri -Recurse -Force -ErrorAction silentlycontinue
# deleting the shortcut on desktop
$ShortcutsToDelete = Get-ChildItem -Path "C:\Users\$env:username\Desktop" -Filter "zluri.lnk"
$ShortcutsToDelete | ForEach-Object {
Remove-Item -Path $_.FullName
}
}
}
# function to create client-config.json file
function zluriClientConfigFiles{
# reading param
Param([String]$configFolderPath)
# Setting variable for folder path & file path
$folderPath = $("$configFolderPath\zluri")
$filePath=$("$folderPath\client-config.json")
# If there is no folderPath then create a zluri folder in that specific location
If (-not (Test-Path $folderPath)) {
Log-Message "Creating zluri folder in $folderPath"
New-Item -Path $folderPath -ItemType "directory"
}
# If there is a client-config.json file in the filepath remove the file
If (Test-Path $filePath) {
Log-Message "deleting existing $filePath"
Remove-Item $filePath
}
# Create client-config.json file in the filepath & insert the values
New-Item -Path $filePath -ItemType "file" -value $configValues
Log-Message "Created client config file in $filePath"
}
# Calling the function to create client-config.json file in programdata
zluriClientConfigFiles -configFolderPath $env:programdata
# Calling the function to create client-config.json file in localappdata
zluriClientConfigFiles -configFolderPath $env:localappdata
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article