Peter The Pestdoctor Mac OS
Peter The Pestdoctor Mac OS
- Peter The Pest Doctor Mac Os Catalina
- Peter The Pest Doctor Mac Os X
- Peter The Pest Doctor Mac Os Download
- Peter The Pest Doctor Mac Os 11
Today I presented a session about Mastering Apple OS X with Configuration Manager 2012 R2 at the Swiss Configuration Manager User Group in Bern. Mac OS X support by Configuration Manager 2012 R2 has two ways of supporting Settings Management namely, managing settings through preferences directly or managing it through Shell Scripts. One of the things I showed was the ability to change user preferences in Mac OS X. In an earlier blog I described how you could use the $USER variable if you want to change a user setting, but for some reason how the Configuration Manager clients interacts with Mac OS X is changed. The context in which the Configuration Manager client runs and now changes preferences or running scripts is not the current user but the ROOT user. System preferences can still be changed via the native Mac OS X preferences.
So for this reason you see that nothing is changed when pointing to a preference file in a Configuration Item in Configuration Manager like this ~/Library/Preferences/com.apple.safari . The Tilde (~) means current user so when checking and changing “~/Library/Preferences/com.apple.safari” you will actually check and change the file located in /users/root/Library/Preferences/ . This took me a while to figure that out but, but it is logical that the Configuration Manager client runs in a different context since the client needs unlimited access to the system.
Mac OS X Tiger (version 10.4) is the fifth major release of macOS, Apple's desktop and server operating system for Mac computers. Tiger was released to the public on April 29, 2005 for US$129.95 as the successor to Mac OS X 10.3 Panther.Some of the new features included a fast searching system called Spotlight, a new version of the Safari web browser, Dashboard, a new 'Unified' theme,.
Pest Doctor SM is brought to you by Lawn Doctor who has been providing lawn services for the last 47 years. Our goal is to make your outdoor living space as beautiful and enjoyable as possible. For more information you can go to: www.lawndoctor.com. Pest Doctor is the BEST Doctor for diagnosis & treatment of pest problems. Our customized solutions are a practical blend. Explore the world of Mac. Check out MacBook Pro, MacBook Air, iMac, Mac mini, and more. Visit the Apple site to learn, buy, and get support.
So to be able to change user preferences, like the default homepage of Safari, we need to create a script that is able to gather and use the user that is currently logged on the Mac OS X device, check the setting and remediate it if necessary.
Discovery Script
The discovery script is used to find and return the value of a setting that you want to assess, so for us the first step is checking the current user, thanks to the great community I was able to figure this out quickly. With the command stat -f%Su /dev/console you are able to report the current user that is logged on. Placing the current user to a variable which can be used in the script is done as follows myuser=$(stat -f%Su /dev/console).
The second step is gathering the current setting of the default homepage of Safari. With the command defaults read you are able to read certain settings. If we combine the variable with the defaults read command you should be able to retrieve the current setting of the default homepage of Safari. The command defaults read /users/$myuser/library/preferences/com.apple.Safari HomePage will report the current value. Because we want to check the current value, it is wise to also place the value to a variable like shown above.
Peter The Pest Doctor Mac Os Catalina
The discovery script
Next we need to check if the current value is set the way we want to and report (echoed) a value based of the result. This value can be used while checking if the setting needs to be remediated or not.
Setting rule to define the compliance for this setting
Remediation Script
If the default homepage needs to be remediated we need to create a remediation script. The first step is again retrieving the username of the user that is logged on to the system before we are going to actually remediate the preference setting. With the command default write you are able to change settings of a specific value in a preference file. To be able to change the default homepage of Safari you need to execute the following command; defaults write /users/$myuser/library/preferences/com.apple.safari HomePage -string “http://configmgrlab.com” . After the setting is changed also the permissions to the com.apple.safari.plist file are changed so that users cannot access the file anymore. So you need to revert the permissions with the following command; chmod ugo=rwx /users/$myuser/library/preferences/com.apple.safari.plist. Meaning that all users will be having Read, Write and Access permissions to the file.
Download the CAB file of the exported Configuration Baseline here and please let me know what you think! Always test the baseline first in a lab environment before using it in a production environment
Comments
This is a list of various unix projects I've installed under Mac OS X andany issues I have in making them work.
Contents
Environment Variables
Under Mac OS X, environment variables can be configured in three differentplaces, and each one makes the variables available to different things:
- ~/.MacOSX/environment.plist - used by everything you launch directly.
- ~/.cshrc or ~/.tcshrc - used by any tcsh shell you launch (including remotely).
- crontab file - you can also set envrionment variables in your crontab.
~/.MacOSX/environment.plist
This file isread in when you log in as a user under Mac OS X. All the variablesare made available to any application or process you launch, which probably includesthe Terminal and hence any shells you open directly. In particular, this wouldinclude applications like BBEdit and CodeWarrior which runs scripts (like perl andcvs) on your behalf.
This file is a plist and can be edited with the property editor, or manually,or it can be created magically from your existing environment via a script.
Changes take effect at login, so you'll need to logout and log back in.
~/.cshrc or ~/.tcshrc
These files (only ever have one), are used by any tcsh shell you launch,including remotely accessed ones. Terminal launched ones probably pick up the environment.plist variables, but if you ssh into your Mac from another Mac, then probably not.
crontab file
When you add cron jobs (using conrtab -e), they are neither run under your Mac OS Xlogin nor under a tcsh shell, so you can also set envrionment variables in your crontab which will get used when executing cron actions.
exim
exim is a mail server with some very nice features.
Peter The Pest Doctor Mac Os X
exim-comp
This is a little Perl script I wrote to compile simple expressions into exim expressions. Hopefully it'll be useful to someone. here are some examples:
Notes:
- Strings must be quoted with single or double quotes. No expansion is done, and quotes cannot contain the quotation mark used.
- Functions that return a string are stated as $func(params)
- Functions that return a condition are stated as func(params)
Caveats:
Peter The Pest Doctor Mac Os Download
Not much testing (all the above run through exim -be, but whether they are correct I could not say!).
Peter The Pest Doctor Mac Os 11
No documentation.
Available from here.
Peter The Pestdoctor Mac OS