Posted on 07-26-2018 06:26 PM
Cached Install macOS High Sierra to all the iMacs here and instead of landing in the applications folder it landed on the desktop... every users desktop. Was wondering the command line to remove from all of the users desktops (or an easier way if possible?)
rm -rf “/users/don’t want to have to input every user/desktop/Install macOS High Sierra.app”
Posted on 07-26-2018 06:50 PM
Are you sure it's one every users desktop and not just the same username that was used for packaging?
I wouldn't think it would end up everywhere unless you had FUT and FEU selected.
Posted on 07-27-2018 01:22 AM
rm -rf "/Users/*/Install macOS High Sierra.app"
aught to do it.
Posted on 07-27-2018 08:10 AM
@neil.martin83 Ran the command through ard while monitoring a students machine, command said it was successful but it was still on the desktop.
@Look I didn’t do the initial package build so I’m gunna go ahead and say those were selected. And now I’m running clean up.
Posted on 07-27-2018 09:15 AM
The command above doesn't include "Desktop" in the path. If the installer really landed on their Desktops, and not in the root of their home folder, then you have to include that. Also, I don't know how well it works to enclose the path in double quotes when using a * wildcard. You could run into issues with that. You can try this:
rm -rf /Users/*/Desktop/Install macOS High Sierra.app
But truthfully something like the following might be more reliable
#!/bin/bash
for u in $(ls /Users); do
if [ -d "/Users/$u/Desktop/Install macOS High Sierra.app" ]; then
rm -R "/Users/$u/Desktop/Install macOS High Sierra.app"
fi
done
You could even include an echo in there to confirm it found it on any user's desktops and deleted it. That would show up in the policy log as a confirmation of what it did.
Posted on 07-27-2018 09:32 AM
Just use the JSS Restricted Software option to delete ALL instances of Install macOS High Sierra.app, then push it out again to the /Applications folder.
Posted on 07-30-2018 08:46 AM
@Cornoir Wow, never even thought of running it through there. Does it have to be clicked on before it disappears?
Posted on 07-30-2018 09:28 AM
Does it have to be clicked on before it disappears?
Yes, any application or process that's set up in Restricted Software only gets removed (if that option is enabled) when it's run. It won't remove it silently in the background if the clients aren't trying to launch the software. So in my mind, it's not really a great option to use. I would probably use a scripted method of removing it.
Posted on 07-31-2018 10:48 AM
@mm2270 yeah I thought so. I do like the idea of allowing the students to do my work for me. We all know if there’s something on the desktop they are going to click on it.
But I will end up giving your scripts a try. I ran into issues with the * in my previous scripts, so it looks like your second option should do what I need.
I really appreciate your help buddy.