Posted on 05-04-2017 09:45 AM
Hello,
Im trying to remove the Office 2011 data folder for users. I have not had success wit hit.
I tried to create a policy via composer as a DMG to uninstall and no remove scripts are working. Its the folder under Documents/Microsoft User Data
Posted on 05-04-2017 09:55 AM
This should be pretty simple to do with a script. Are you looking to remove the directory from just a single user, like the logged in or main user of the machine, or just any of them?
I wouldn't even try doing this with a DMG set to uninstall. That isn't going to work very well in this case.
Posted on 05-04-2017 09:56 AM
~duplicate~
Posted on 05-04-2017 09:56 AM
Depending on how you're trying to do it... You could do this
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
rm -rf /Users/$loggedInUser/Documents/Microsoft User Data/path/
Regards,
TJ
Posted on 05-04-2017 02:33 PM
Try :
rm -rf /Users/$3/Documents/Microsoft User Data/ - this will delete the Microsoft user Data folder
rm -rf /Users/$3/Documents/Microsoft User Data/* -this will delete the items inside Microsoft Data Folder
Basically,just replace the loggedon username with $3
Posted on 05-05-2017 06:43 AM
@tthurman this worked great! Thank you.