Search

Language:  

Available article translations:

How to change desktop background in OS X through Desired Configuration Management

APPLIES TO:
  • Parallels Mac Management

Information

To change the desktop background in OS X through Desired Configuration Management, you can create a script with appropriate instructions and include it in a configuration item that will be used to evaluate Macs for compliance.

Note: This article does not provide details about setting up and using Desired Configuration Management. For the complete information about creating configuration items and evaluation scripts, please read the Desired Configuration Management section (including the Using Scripts to Assess Compliance sub-section) of the Parallels Management Suite for Microsoft SCCM 2012 Administrator’s Guide.

Follow the instructions provided in the guide (see link above) and open the Create Configuration Item Wizard. When specifying the settings on the Create Setting dialog, create a discovery script as follows:

  1. In the Setting type list box, select Script.
  2. In the Data type list box, select String.
  3. In the Discovery script section, click Add Script.
  4. In the Edit Discovery Script dialog, copy and paste the following script in the Script edit box (change the value of the WALLPAPER_PATH variable to contain a path to your image file):

    WALLPAPER_PATH="/Library/Desktop Pictures/Snow.jpg"
    
    CONSOLE_USER=$(ls -la /dev/console | awk '{print $3}')
    if [[ ${CONSOLE_USER} == "root" ]]; then
        exit 0 # Silently exit if there is no console user
    fi
    
    if [[ ! -f ${WALLPAPER_PATH} ]]; then
        echo "No such file: ${WALLPAPER_PATH}" 1>&2
        exit 2
    fi
    
    sudo -u $CONSOLE_USER /usr/bin/osascript -e "tell application \"System Events\" to set picture of every desktop to \"${WALLPAPER_PATH}\""
    EXIT_CODE=$(echo $?)
    
    if [[ ${EXIT_CODE} != 0 ]]; then 
        exit ${EXIT_CODE}
    fi
    
    echo "OK"
    exit 0
    

When done adding the script, click OK to close the Edit Discovery Script dialog.

You now need to create a compliance rule using the following steps:

  1. Click the Compliance Rules tab in the Create Setting dialog.
  2. Click New to open the Create Rule dialog.
  3. Type in the rule name and an optional description.
  4. In the Rule type list box, select Value.
  5. In The value returned by the specified script list box, select Equals.
  6. In the following values edit box, type “OK” (without quotes).

Complete the Create Configuration Item Wizard as described in the Parallels Management Suite for Microsoft SCCM 2012 Administrator’s Guide.




1d79b51112684448ad06c14bdc779b0d

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No