Home Forums OS X Server and Client Discussion Open Directory Plists and Multiple User Names

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #377964
    NOEQ
    Participant

    Hi,

    I’ve run into an issue with a piece of software (Autodesk Alias Automotive 2010) and environment variables.

    All our users details are in AD, with an Xserve and OD managing user and computer groups. I generally distribute plists via Workgroup Manager.

    I need to create and add a specific ‘environment.plist’ for each user of the above application. The plist needs to end up here:

    /Users/user_name/.MacOSX/environment.plist

    The ‘environment.plist’ needs to contain the following:


    



    ALIAS_WORKENV
    
**ENTER LOCATION OF WORKING ENVIONMENT**

    The working environment location will be something like:

    /Volumes/Media/User_Name/Alias Working Environment Folder

    How can I distribute .plists to specific users en masse? There’s approx 100 users for this particular application.

    What’s the best way to create the above file. I’ve tried it with textedit in plain text mode, but WGM doesn’t like the resulting file. I then took an existing .plist, which I renames and edited. WGM appears happier.

    Any advice greatly appreciated!

    #377967
    Greg Neagle
    Participant

    Workgroup Manager will be of no help here – it can’t help manage the ~/.MacOSX/environment.plist.

    You’ll need to write a script that copies this file from a known location to the user’s home folder, (or perhaps just creates it), and then set this script to run at login, perhaps via a launchd LaunchAgent.

    Something like:

    [code]
    #!/bin/sh

    if [ ! -d ~/.MacOSX ]; then
    mkdir ~/.MacOSX
    fi

    defaults write ~/.MacOSX/environment ALIAS_WORKENV “/path/to/working/environment”
    [/code]

    The LaunchAgent plist would look something like:

    [code]


    Label
    com.myorg.loginscript
    LimitLoadToSessionType

    Aqua

    ProgramArguments

    /path/to/my/script/to/run/at/login

    RunAtLoad
    [/code]

    #377971
    NOEQ
    Participant

    Thanks for getting back.

    Any idea why this problem occurs only for users in the Active Directory? If I create users in our own Open Directory, and even assign them to the same group as the nested AD users, no problems. The application boots fine.

    Could it be permissions?

    #377988
    tlarkin
    Participant

    Do you have multiple users per a system? If so, do their home folders actually reside in /Users?

    #377993
    NOEQ
    Participant

    Hi,

    Yes, I have multiple users per system. Their home folders reside on an Xserve, not /Users

    Thanks

    #378004
    tlarkin
    Participant

    [QUOTE][u]Quote by: NOEQ[/u][p]
    Hi,

    Yes, I have multiple users per system. Their home folders reside on an Xserve, not /Users

    Thanks[/p][/QUOTE]

    I would say create a loop through the home folders since they will have the user’s short name and then execute a command, quick example would be:

    [code]
    #!/bin/bash

    HomePath=`/bin/ls /path/to/homes`

    for file in $HomePath ; do

    defaults write my command

    exit 0
    [/code]

    Or, I would use a log in hook to do it when a user logs in, exmaple:

    [code]
    !#/bin/bash

    # get current logged in user by checking who owns /dev/console

    CurrentUser=`/bin/ls -l /dev/console | awk ‘{ print $3 }’`

    sudo -u $CurrentUser defaults write /path/to/file

    exit 0
    [/code]

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Comments are closed