Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-2501: How to use an AppleScript as a login script

Centrify Identity Service, Mac Edition ,  

12 April,16 at 10:57 AM

Applies to: All versions of Centrify DirectControl for Mac OS X.

Question:

How to use an AppleScript as a login script?


Answer:

To execute an Applescript file from a login script, use the following steps:
  1. Use the Copy File GP to copy an AppleScript file from Active Directory to the Mac.
    • Computer Configuration / Centrify Settings / Common UNIX Settings / "Copy files"
    • Make sure "Copy as binary file" is enabled.
  2. Use a login script with the "osascript" command to run the Applescript from the shell.
    • User Configuration / Centrify Settings / Mac OS X Settings / Scripts / "Specify login script"

Please see the following Apple Manual page for osascript usage:
Note:
  • By default, the Group Policies are updated every 90 minutes and this in turn means that the Copy File GP will copy the AppleScript file over the network every 90 minutes as well. 
  • In most instances, it is completely safe to leave this policy switched on.
    • However, if this behaviour is not desired; then the Copy File GP should be disabled (or the AppleScript entry removed from the policy) after the file has been copied over onto the local machine.
  • The login script will only run at login time.

References (provided as a courtesy):

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.