microsoft / shell-intune-samples

Sample shell scripts for Intune admins.
MIT License
627 stars 213 forks source link

macOS - Kernal Panic when executing addAppstoDock.sh shell script during Intune ADE #124

Closed jkerekes99 closed 3 weeks ago

jkerekes99 commented 3 months ago

OS Version: macOS 14.4 Test device: M1 Macbook Air

Deploying all applications via the Intune Scripting Engine. Apps being deployed:

All apps using scripts from this github repo.

appApptoDock.sh items: dockapps=( "/Applications/Microsoft Edge.app" "/Applications/Microsoft Outlook.app" "/Applications/Microsoft OneNote.app" "/Applications/Microsoft Teams (work or school).app" "/Applications/OneDrive.app" "/Applications/Microsoft Word.app" "/Applications/Microsoft Excel.app" "/Applications/Microsoft PowerPoint.app" "/Applications/Microsoft Remote Desktop.app" "/System/Applications/Messages.app" "/System/Applications/FaceTime.app" "/System/Applications/Freeform.app" "/Applications/Company Portal.app" "/System/Applications/App Store.app")

Steps to reproduce:

  1. Setup enrolment profile / ADE via ABM
  2. Assign the above app scripts .
  3. Assign appAppstoDock.sh .
  4. Enrol test device via ADE Intune.
  5. All the above apps proceed to install.
  6. Immediately after the last app is installed, addAppstoDock.sh is waiting...and immediately causes a Kernal Panic and the mac reboots.
theneiljohnson commented 3 months ago

Thanks for this, i'm seeing the same behaviour. I've no idea why at this stage. If I run the script manually, or even a minute or so after all the apps have been installed it doesn't seem to do it.

I'm tempted to just add a longer delay at this point.

jkerekes99 commented 3 months ago

@theneiljohnson thanks for confirming its not just me :) I see the same behaviour, if I run it manually I don't get a kernal panic.

When you add a longer delay, do you still get a kernal panic? I believe there is a 30 second sleep already in place, but the strange thing is the kernal panic happens immediately after the last app gets installed.

Gregzy1987 commented 2 months ago

Hi both, Following this issue as i too am experiencing the same issue. I tried adding a longer delay but it didn't make a difference on my end unfortunately.

I did notice the reboot changed with the delay and went from 10 seconds to 60 seconds with no success, after the last app was installed.

jbba2023 commented 2 months ago

I have also noticed this issue. It happened during my training videos I was making for our helpdesk. It hasn't happened since and I was using that Mac for a good while before enrolling into Intune and I was using it for a good while before applying dock config whilst enrolled as well.

theneiljohnson commented 3 weeks ago

I've spent a bit of time this morning to create an updated build of this script. It now runs as root and uses dockutil. Let me know what you think.

jbba2023 commented 3 weeks ago

Amazing, had a few things put on hold here regarding our Mac/Intune rollout but i'll flag this for myself and do some testing in the coming weeks.

jkerekes99 commented 3 weeks ago

I've spent a bit of time this morning to create an updated build of this script. It now runs as root and uses dockutil. Let me know what you think.

Thank you! Will test this soon.

For the modern management project I was working on, I ended up working around the issue and used your original script with Outset . Outset allows you to run scripts as the user when Intune can't. Just package up your scripts and put them in the correct locations.