Home › Forums › OS X Server and Client Discussion › Open Directory › Plists and Multiple User Names
- This topic has 5 replies, 3 voices, and was last updated 15 years, 1 month ago by
tlarkin.
-
AuthorPosts
-
February 9, 2010 at 1:39 pm #377964
NOEQ
ParticipantHi,
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!
February 9, 2010 at 4:44 pm #377967Greg Neagle
ParticipantWorkgroup 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/shif [ ! -d ~/.MacOSX ]; then
mkdir ~/.MacOSX
fidefaults write ~/.MacOSX/environment ALIAS_WORKENV “/path/to/working/environment”
[/code]The LaunchAgent plist would look something like:
[code]
[/code]
Label
com.myorg.loginscript
LimitLoadToSessionType
Aqua
ProgramArguments
/path/to/my/script/to/run/at/login
RunAtLoad
February 10, 2010 at 10:04 am #377971NOEQ
ParticipantThanks 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?
February 16, 2010 at 8:57 pm #377988tlarkin
ParticipantDo you have multiple users per a system? If so, do their home folders actually reside in /Users?
February 17, 2010 at 9:17 am #377993NOEQ
ParticipantHi,
Yes, I have multiple users per system. Their home folders reside on an Xserve, not /Users
Thanks
February 17, 2010 at 6:12 pm #378004tlarkin
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/bashHomePath=`/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] -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed