Hey everyone. Looking to create a smart group, via an Extension attribute, that looks for every MacOS device that has the home folder 'test'. So /Users/test. Having trouble putting together the script for the extension attribute that can look or every device with this home folder. Would appreciate some help.
I then want to delete that home folder for all confirmed devices by scoping the smart group and using the command 'sudo rm -rf /Users/test'. Does this seem like a reasonable way to accomplish this?
I guess I could just blast every device with this command, but that seems a little unwise... 😉
EDIT- I got the script figured out (see below), but still looking for advice on best approach for deleting the home folder on devices that have it. Thanks.
#!/bin/bash
if [ -d /users/ ]; then
echo "<result>Has test Folder</result>"
else
echo "<result>Does Not Have test Folder</result>"
fi
exit