Skip to main content
Solved

Setting Regions

  • May 13, 2015
  • 2 replies
  • 30 views

Forum|alt.badge.img+8
  • Valued Contributor

HI All,

Having some issues with our new lab images where the default region is set to Australia - root, this will stop Applications such as word from opening......

When you change the region from this to Australia then word opens fine.

I have tried this https://jamfnation.jamfsoftware.com/discussion.html?id=12955 setting the region but it fails station update_region not found.

Any other ideas? Im not even sure where the region code comes from with the "Australia - root"

thanks

Best answer by Simmo

Curious how you managed to get it set to Australia in the first place.
I use the script mentioned in the link in your post. Are you sure you've set it up correctly?

The parts that you need to have in your script for it to work are:

PLBUDDY=/usr/libexec/PlistBuddy
REGION="en_US"

update_region() {
  ${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null
  ${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null
  ${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null
  ${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null
}

update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}"

for HOME in /Users/*
  do
    if [ -d "${HOME}"/Library/Preferences ]
    then
      cd "${HOME}"/Library/Preferences
      GLOBALPREFERENCES_FILES=`find . -name ".GlobalPreferences.*plist"`
      for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES}
      do
        update_region "${GLOBALPREFERENCES_FILE}" "${REGION}"
      done
    fi
done

2 replies

Forum|alt.badge.img+12
  • Contributor
  • Answer
  • May 13, 2015

Curious how you managed to get it set to Australia in the first place.
I use the script mentioned in the link in your post. Are you sure you've set it up correctly?

The parts that you need to have in your script for it to work are:

PLBUDDY=/usr/libexec/PlistBuddy
REGION="en_US"

update_region() {
  ${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null
  ${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null
  ${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null
  ${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null
}

update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}"

for HOME in /Users/*
  do
    if [ -d "${HOME}"/Library/Preferences ]
    then
      cd "${HOME}"/Library/Preferences
      GLOBALPREFERENCES_FILES=`find . -name ".GlobalPreferences.*plist"`
      for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES}
      do
        update_region "${GLOBALPREFERENCES_FILE}" "${REGION}"
      done
    fi
done

Forum|alt.badge.img+8
  • Author
  • Valued Contributor
  • May 13, 2015

cheers, thanks.....

missed the ${PLBUDDY} parts....

I should read a little more of the script and not just start deleting chunks