deploy a shell script to remove certain home directory

Dalmatian
Contributor

Hi All

I was trying to deploy a chrome package to the whole company, but unfortunately we found after the deployment a new home directory was added under /Users on everyone's Mac. how can i remove this home directory?
for exapmle, the home directory is /Users/test

i created a shell like the following

!/bin/sh

rm -rf /Users/test

i tried this shell, can remove /Users/test by inputing sudo ./deleletestdirrectory.sh locally,

but none of them got removed on JSS. this is kind of urgent, could someone help on this ?

thanks so much

1 ACCEPTED SOLUTION

Simmo
Contributor II
Contributor II
4 REPLIES 4

bpavlov
Honored Contributor

Just based off the computer you've given, why not try to create a policy that runs a simple command of "rm -rf /Users/test" ? Set to it once per computer.

Dalmatian
Contributor

@bpavlov

how can i simply run command line via JSS? there is no place to fill in a cli rather than a script to choose.
c2b7a0d1f5e041aeb56a2798c16c15bd

thanks

Simmo
Contributor II
Contributor II

Dalmatian
Contributor

@sibc thanks it works