/build/static/layout/Breadcrumb_cap_w.png

Mac - Hiding the Security and Privacy Preference Pane via Offline KScript

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

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ