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