rtrouton / rtrouton_scripts

Scripts to share
MIT License
1.3k stars 489 forks source link

Operation not Premitted #62

Closed jscocca closed 4 years ago

jscocca commented 5 years ago

When I run the script it tried to rename the home director to username.old at this point the script comes back and gives error operation not permitted. The home directory is still there, but the account gets deleted. I would like to be able to use this script as I have a client who has over 50 macs to domain.

Thank you.

rtrouton commented 5 years ago

I don't know which script you're referring to. More details, please.

jscocca commented 5 years ago

Oh my bad, I am using MigrateLocalUserToADDomainAcct.command.

martinp0 commented 5 years ago

Hi, @jscocca

I had similar issue, but solved it by disable rootless in Recovery mode with csrutil disable, than re-run chmod and it was fine.. than it is a good idea to enable csrutil again

https://www.quora.com/How-do-I-turn-off-the-rootless-in-OS-X-El-Capitan-10-11

rtrouton commented 5 years ago

If this issue is happening on Mojave, it's because of the user privacy protections which Apple has applied to the account home folders. Unfortunately, that's not an issue with how the script works so it can't be fixed within the script.

Turning off SIP also disables the user privacy protections.