forced user prefs problems

closer

Registered
I've got a couple of different questions that I've also posted in the Apple discussion site (but as usual don't expect a reply from... nobody ever seem to answer much there)... anyway, hope we can come up with some dialogue here...

In MacManager I used to be able to force preferences into a users account on their startup... can't seem to figure out where to do this in WorkGroup Mgr (10.3.8 on both client and server)... One pref I want to make standard on user startup is the Safari one.... I want to be able to share a series of tabs with entire student population, and initially with the teachers... and also have the history cleared after each session so it is not available next session...

any ideas where I should look?
 

Go3iverson

Registered
Hmm, so you want to push out safari bookmarks, as tabs, to all of your clients at login?

Here's what I'd do...

Set up a clean version of Safari with those bookmarks. Take the ~/Library/Safari/Bookmarks.plist file from the ideal Safari config and place it in an area accessable by all of your clients, either on a server or maybe in /Users/Shared.

Write a quick script that takes the Bookmarks.plist file from that public area and copies it to ~/Library/Safari/ for the user that's currently logging in. Make that script a managed login item on all your clients via Workgroup Manager.

Obviously, try this in a test environment first! :)

Hope this helps!
 

closer

Registered
wow... I knew this board was way better than AppDiscGroup... thanks for the speedy answer

Go3iverson said:
Hmm, so you want to push out safari bookmarks, as tabs, to all of your clients at login?
We kind of have to do this to retain our internet access (Young Offenders Facility and security is an issue)... also don't want xxx.com stuff bookmarked!!

Go3iverson said:
Set up a clean version of Safari with those bookmarks. Take the ~/Library/Safari/Bookmarks.plist file from the ideal Safari config and place it in an area accessable by all of your clients, either on a server or maybe in /Users/Shared.
no problem doing that... sounds similar to what I used to do in MacMgr and with (shiver) IE pref's only all I had to do there was drop the IE prefs in the forced preferences folder (MacMgr) on the server

Go3iverson said:
Write a quick script that takes the Bookmarks.plist file from that public area and copies it to ~/Library/Safari/ for the user that's currently logging in. Make that script a managed login item on all your clients via Workgroup Manager.
there's where it breaks down for me... don't know much about script writing, and in WrkGrpMgr I assume you're talking about the group preferences?... is this where I would activiate the script (that I don't really know anything about)

Go3iverson said:
Obviously, try this in a test environment first! :)
I have a test setup so the hounds aren't after me daily!!

out in the boonies with nobody to talk to but you guys... so thanks for your help... much appreciated...
 

Go3iverson

Registered
Yup, you got it right. In the group preferences in WGM you can set up login items. Try something like this:

#!/bin/bash
#Copy prefs from /Users/Shared to ~/ for Safari
#
#Written by Michael Dhaliwal

ditto -rsrc /Users/Shared/Bookmarks.plist ~/Library/Safari
exit

I haven't tested it, but its simple and the syntax is pretty straight forward for you to edit how you please. Simply takes the Bookmarks.plist file and moves it to the specified directory. Make sure to give the script proper permissions to run. Check out man chmod. You could use 755 for this, if you like.

:)
 

closer

Registered
Go3iverson said:
ditto -rsrc /Users/Shared/Bookmarks.plist ~/Library/Safari
exit:)
newbie question again... so when the user logs in it activiates this script and moves the Bookmarks.plist to the users own own safari pref folder... and I also must be able to do the same with the History.plist??... is there also a standard .plist for safari that includes the setup to allow for tabs and other safari prefs?

and... another neewbie and... where do I input the above script... do I save it as a specific file that I then Add through the Groups->Research (that's the name of our student group)->Preferences->LoginItems->Add... then locate the script by filename... or am I missing something here!

thanks again for bearing with a newbie
 

Go3iverson

Registered
You could create a directory in /Library called LoginHooks and place them in there. If you want, you can tell loginWindow to execute the scrips for you at login (funny how that works, huh?!) :)

The terminal command looks like:

sudo defaults write com.apple.loginwindow LoginHook /Library/LoginHooks/ScriptNameHere

You should be able simply blow away the History.plist file. I'd think Safari would create a new one on first use. So add this into the script we've been assembling:

rm ~/Library/Safari/History.plist

Hope this is helping you! Workgroup Manager is a great tool from Apple and the scripting capabilities of OS X make it a real dream to work with! :)
 

closer

Registered
once again... many thanks!

what I'm realizing now is that I should be attending AppleScriptWriting school somewhere!... is there a site online that you can recommend that is good for starting a real AS newbie about AS?... then maybe I wouldn't be bugging you about some of the basics...
 

Go3iverson

Registered
Nah, bug away! I like to give folks help. We've all been new to this at some point or another. :)

The scripts I've been giving you are shell scripts. That's the more UNIX way of scripting for OS X. There also is AppleScript, which works on the Mac platform quite well and is a more English based syntax. You can find lots of docs on AppleScript on Apple's site and the developer.apple.com website as well. Those are free. ;)
 
Top