6.3 PLIST Deployment Needed for Deploying the MAC Agent via InTune
The following needs to be created as a custom script in InTune.
Open InTune and navigate to Devices/macOS/Manage Devices/Scripts. Click Add.
Add name and Description of the Script:
Click Next
Add the following script to the text editor and save this to your machine.
#!/bin/bash
# Define the target path
PLIST_PATH="/Library/Preferences/com.roboshadow.roboclientmac.plist"
# Use sudo to ensure permissions
sudo bash -c "cat << EOF > $PLIST_PATH
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \http://www.apple.com/DTDs/PropertyList-1.0.dtd\>
<plist version=\"1.0\">
<dict>
<key>FIRST_RUN_KEY</key>
<true/>
<key>SUHasLaunchedBefore</key>
<true/>
<key>LAST_RUN_TSTDONE</key>
<string>Done</string>
</dict>
</plist>
EOF
"
# Set appropriate permissions
sudo chmod 644 $PLIST_PATH
Once you save the file go back to InTune and upload the script. Set the rest of the settings as per the screen shot. You may need to tweak these to work with your devices but this worked for us:
Click Next
Scope tags – Can be left as default
Click Next
Assignments – Depending on your InTune setup, assign to the required devices. We created a dynamic group to capture all MAC devices and add the assignment to that group.
Click add to finalise the script.
Test deployment and confirm this is deploying to devices. To test for issue, try running the script locally on a device to confirm no permissions issues or syntax issues with the script.