Disabling Safari Pop-up through script - user/permission problem?

stoneacheck
New Contributor III

I'm trying to send a remote script to a set of student laptops through a policy and I'm having some trouble. I assume it's something to do with the management account is the admin and the account we want to alter is the student account (and a standard user?).

The following terminal command sets the checkbox for "Block pop-up windows" to off when run in the user

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool true

(found via http://macmule.com/2012/07/31/disabling-safari-5-1-xs-6-xs-pop-up-blocker-from-terminal-2/)

When I set the policy to run on the test client machine (also 10.9.4, new image) in the student user it gives exit code 0, which some googling tells me is a success. The details of the policy log say

Executing Policy Disable Safari Pop-Ups...
[STEP 1 of 1]
Running script Disable Safari Pop-ups...
Script exit code: 0
Script result:

yet, the plist file never gets altered. I've tried adding read/write access for the admin account to the preferences folder, I've looked at logs in console, they all say they're executing the policy but I can't figure out why its not writing the value to the plist.

If I copy and paste the command into terminal in the user and hit return it will execute properly and add the key and the value into the plist just fine.

What am I missing?

1 ACCEPTED SOLUTION

bentoms
Release Candidate Programs Tester

Hi @stoneacheck,

Thanks for looking at my site. :)

If you're running the above via Casper Remote you'll be running it as root, & so will be setting it on root's account.

Do you have Managed Preferences setup on you JSS?

If so, you can add it there & then it will be set at every login.

View solution in original post

5 REPLIES 5

bentoms
Release Candidate Programs Tester

Hi @stoneacheck,

Thanks for looking at my site. :)

If you're running the above via Casper Remote you'll be running it as root, & so will be setting it on root's account.

Do you have Managed Preferences setup on you JSS?

If so, you can add it there & then it will be set at every login.

stoneacheck
New Contributor III

We haven't done MCX, our jumpstart engineer told us to stay away if we hadn't in the past. I was just gonna try with a configuration profile using "custom settings" and upload an example plist to see if that worked.

bentoms
Release Candidate Programs Tester

That should work too.

Profiles are just another way of delivering managed preferences anyways.

stoneacheck
New Contributor III

Yep, that worked nicely. We just needed it for MAP testing tomorrow so kids can launch the test. I imagine i'll have to edit/remove it at some point if they want different settings for different schools since that same plist overrides all kinds of stuff right, not just the single key I wanted to alter.

bentoms
Release Candidate Programs Tester

Yea.

Normally you've have 1 profile per payload, but also 1 per app.

So 1 profile for Safari with only the settings you want to set.