Skip to main content
Solved

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


Forum|alt.badge.img+9

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?

Best answer by bentoms

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 original
Did this topic help you find an answer to your question?

5 replies

bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • Answer
  • August 11, 2014

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.


Forum|alt.badge.img+9
  • Author
  • Contributor
  • 50 replies
  • August 11, 2014

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
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • August 11, 2014

That should work too.

Profiles are just another way of delivering managed preferences anyways.


Forum|alt.badge.img+9
  • Author
  • Contributor
  • 50 replies
  • August 11, 2014

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
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • August 11, 2014

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings