All, 

I'm working to deploy a simple script that will search for the com.apple.systempreferences.plist within the /Library/Managed Preferences/"logged in user"/ folder.

-If .plist exists i want it to create the HiddenPreferencePanes array and add the com.apple.preference.security key within the new array. After modification i (think i) need the .plist permissions to change to Root as owner and 755.

-If .plist does NOT exist, i want to run a simple script to create the .plist then add permissions (stated as if exists) as Root as owner and mod to 755.

 

Question: Can you add a user variable ($USER) into the Parameters section within launching a program? Refer to the following.

 

Verify

  1. Verify that the plist value “com.apple.systempreferences” in the plist “/Library/Managed Preferences/$USER/” exists.

On Success

  1. Launch “/usr/bin\defaults” with params “write /Library/Managed Preferences/$USER/com.apple.systempreferences.plist HiddenPreferencePanes -array-add com.apple.preference.security”.
  2. Launch “/usr/bin\dscl” with params “chown root /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
  3. Launch “/usr/bin\dscl” with params “chmod 0755 /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.

Remediation

  1. Launch “/usr/bin\dscl” with params “sudo mv /Library/Application Support/Dell/KACE/data/scripts/169/com.apple.systempreferences.plist /Library/Managed\ Preferences/$USER/”.
  2. Launch “/usr/bin\dscl” with params “chown root /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
  3. Launch “/usr/bin\dscl” with params “chmod 0755 /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.

Thanks!

Doug

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share