All Collections
Agents
Deploying Mac Desktop Agent Through Kandji
Deploying Mac Desktop Agent Through Kandji
This article explains how to deploy Mac Desktop Agent using Kandji
C
Written by Chinmay Panda
Updated over a week ago

In order to deploy Zluri Desktop Agent via Kandji MDM, follow these steps:

1. Click ‘Blueprints’ from the left navigation menu.

2. Click ‘New Blueprint’

3. Click ‘start from scratch’

4. Enter name & description

5. Click ‘Library’

6. Click ‘Add New’

7. Select ‘Mac’ & Click ‘Custom Apps’

8. Click ‘Add & Configure’

9. Add Title, Select the Blueprint created above.

10. In installation, Select ‘Audit & Enforce’

Enter the audit script provided to you:

validateInstallation() {

local ZLURI_APP="/Applications/Zluri.app"

if [[ -e $ZLURI_APP ]]

then

# exit with code 0 (success) if file exists

return 1

else

# exit with code 1 (fail) if file does not exists

return 0

fi

}

validateInstallation

IS_INSTALLED=$?

if [[ IS_INSTALLED -gt 0 ]]

then

exit 0

else

exit 1

fi

11. Add the pre install script, upload the package & add the post install script.

Preinstall script:

#!/bin/bash

ZLURI_PERMISSION=$(sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT COUNT(*) FROM access WHERE service='kTCCServiceScreenCapture' AND client='com.zluri' AND auth_value=2;")

if [[ "$ZLURI_PERMISSION" -gt 0 ]]

then

exit 0

else

echo "Permission is not there for Zluri"

fi

exit 0

Post-install script:

#!/bin/bash

# Requirement:- Getting UUID and passing it to the zluri app via terminal

#getting UUID

UUID=$(defaults read /Library/Preferences/io.kandji.Kandji.plist ComputerURL | awk -F'/' '{print $5 }')

## please replace <org_token> with the token given by CS team

# ORG_TOKEN=<org_token> #"eyq8473jfjjdhdhffq3rqewfew.fawe"

# assigning mdm type

TYPE="kandji"

/Applications/zluri.app/Contents/MacOS/zluri --uuid="$UUID" --org_token="$ORG_TOKEN" --mdm-mac-type="$TYPE"

12. Save & Edit the custom App.

13. Go to ‘Devices’

14. Select ‘Assign Blueprint’, Select the Blueprint and Click ‘Change’

After 15 minutes, minimum, the blueprint will be executed and the zluri app will open performing the auto auth and the tab will close itself.


Did this answer your question?