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

  1. 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 menu

    1. Click on the Select button at the bottom of the blade.

  1. Click on “Select app package file” , Add the intunewin file and click on OK.


+

  1. Fill in the basic details of the application, click on next.

  1. Change the Install behaviour to “User” 

Device Restart Behaviour to “No Specific Action

Click on Next.

  1. Operating System Architecture: Select both 32 Bit and 64 Bit

Minimum OS: The first Option present

Configure additional requirement rules

  1. On the side sheet:

    1. Rule Type: File

    2. Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\

    3. File or Folder: zluri.exe

    4. Detection method: File or folder does not exists

    5. Click on OK

Click on next




  1. Rules configure:”Manually configure detection rules”

    1. On the side sheet:

      1. Rule Type: File

      2. Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\

      3. File or Folder: zluri.exe

      4. Detection method: File or folder exists

      5. Click on Ok

    2. Click on next

  1. Click next for dependencies

  2. Click next for Supersedence

  3. In assignments, choose the same devices/users/ groups that was chosen for the script, and click on next.

  1. 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

  1. Navigate to Devices, and search for Scripts

  2. Click on Add

  3. Choose Windows or Later

  1. Add the basic Details like name and description
    Name: Zluri script
    Description: Zluri script for agent installation


  1. 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”

  1. Assign it to a group/all devices/ all users based on how this is being deployed, click on Next


  1. 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



Can’t find what you are looking for? Let us help you!

How to update and install the Zluri Agent using MS Intune

Modified on Tue, 1 Oct at 2:34 PM

Windows Versions tested on : WIndows 11, Windows 10


Login to your MS Intune

SETTING UP THE APPLICATION INSTALLATION

  1. 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 menu

    1. Click on the Select button at the bottom of the blade.

  1. Click on “Select app package file” , Add the intunewin file and click on OK.


+

  1. Fill in the basic details of the application, click on next.

  1. Change the Install behaviour to “User” 

Device Restart Behaviour to “No Specific Action

Click on Next.

  1. Operating System Architecture: Select both 32 Bit and 64 Bit

Minimum OS: The first Option present

Configure additional requirement rules

  1. On the side sheet:

    1. Rule Type: File

    2. Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\

    3. File or Folder: zluri.exe

    4. Detection method: File or folder does not exists

    5. Click on OK

Click on next




  1. Rules configure:”Manually configure detection rules”

    1. On the side sheet:

      1. Rule Type: File

      2. Path: C:\Users\%USERNAME%\AppData\Local\Programs\zluri\

      3. File or Folder: zluri.exe

      4. Detection method: File or folder exists

      5. Click on Ok

    2. Click on next

  1. Click next for dependencies

  2. Click next for Supersedence

  3. In assignments, choose the same devices/users/ groups that was chosen for the script, and click on next.

  1. 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

  1. Navigate to Devices, and search for Scripts

  2. Click on Add

  3. Choose Windows or Later

  1. Add the basic Details like name and description
    Name: Zluri script
    Description: Zluri script for agent installation


  1. 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”

  1. Assign it to a group/all devices/ all users based on how this is being deployed, click on Next


  1. 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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article