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
- Verify that the plist value “com.apple.systempreferences” in the plist “/Library/Managed Preferences/$USER/” exists.
On Success
- Launch “/usr/bin\defaults” with params “write /Library/Managed Preferences/$USER/com.apple.systempreferences.plist HiddenPreferencePanes -array-add com.apple.preference.security”.
- Launch “/usr/bin\dscl” with params “chown root /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
- Launch “/usr/bin\dscl” with params “chmod 0755 /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
Remediation
- Launch “/usr/bin\dscl” with params “sudo mv /Library/Application Support/Dell/KACE/data/scripts/169/com.apple.systempreferences.plist /Library/Managed\ Preferences/$USER/”.
- Launch “/usr/bin\dscl” with params “chown root /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
- Launch “/usr/bin\dscl” with params “chmod 0755 /Library/Managed Preferences/$USER/com.apple.systempreferences.plist”.
Thanks!
Doug
Answers (0)
Be the first to answer this question