11-16-2021 01:26 AM - edited 11-16-2021 01:27 AM
Is there a guide anywhere on how to convert "defaults write" scripts to configuration profiles, now that we can't run scripts on startup any more?
For example, this Sophos KB article says that to get the Mac to use the domain name instead of the computer name when reporting the username to Sophos Central, I need to type:
defaults write /Library/Preferences/com.sophos.mcs SMEMcsPreferDomainName -bool true; sudo launchctl stop com.sophos.configuration
Can this be converted to a configuration profile with a custom payload?
Posted on 11-16-2021 04:32 AM
Hi @DanJ_LRSFC ,
the script above has two parts:
First part
defaults write /Library/Preferences/com.sophos.mcs SMEMcsPreferDomainName -bool true
Changes the variable
SMEMcsPreferDomainName
in an existing plist file to the value true. You could also do this with a configuration profile.
The second part stops an existing launch daemon
sudo launchctl stop com.sophos.configuration
Stops the job. Opposite of start, and it's possible that the job will immediately restart if the job is configured to stay running.
I think you cannot create this with a configuration profile.
You could put those two lines from your KB article in a shell script, make a policy and let this policy run once per computer for example.