[Casper] Alias for AD network folder (script?)

Miles Leacy miles.leacy at themacadmin.com
Wed Aug 27 15:11:27 PDT 2008


I took this as a challenge, and now I'm frustrated.  I believe I've got most
of the pieces of this together, and that another pair of eyes will be able
to see where my syntax is failing.

### Start Script
userhome="\"/Volumes/Uservolume/Users/"`whoami`\" # tested

echo $userhome > /tmp/userhome #tested

osascript -e 'read posix file "/tmp/userhome"' # tested
# above line returns contents of file which is the POSIX path to the
client's folder, surrounded by quotes

osascript -e 'set userhome to read posix file "/tmp/userhome"' -e 'tell
application "Finder" to make alias file to posix file (userhome) at desktop'
# above line fails with error: 77:128: execution error: Finder got an error:
AppleEvent handler failed. (-10000)
### end script

The following bash command:
osascript -e 'tell application "Finder" to make alias file to posix file
"/Users" at desktop'

puts an alias on your desktop that points to /Users.  I'm having trouble
with the syntax to pass a variable to the Applescript "make alias" function
from the bash shell.  Based on the fact that the command above works, I
assume that when the variable is properly inserted into the osascript
command, you'll get the needed alias.

Of course, you should be able to use the ln command:
/bin/ln -s /Volumes/Uservolume/Users/`whoami` ~/Desktop/`whoami`

2008/8/27 Slutzky, Ben <bslutzky at mph.net>

>  Hi,
> This isn't much of a Casper question, but maybe someone can help.
> Our Macs have single sign-on enabled with Active Directory, and are also
> bound to our Open Directory server for managed preferences. Users save to
> their network folder (their user folder listed in AD). But because the user
> network folders are stored in hard-to-find subfolders in a server share
> containing all network folders, it's difficult for users to find theirs when
> trying to save documents. (For instance, the path to a user's folder might
> be smb://file1/users/bsmith.)
> The actual server share (e.g., "users") is mounted by OS X as a volume when
> a user logs in, but they'd have to find their folder inside another folder
> in that volume. Although OS X automatically creates an alias directly to
> their folder on the dock, that alias isn't accessible from a file saving
> window. I couldn't find a way of "copying" the dock alias to the desktop.
>
> Can anyone think of a way (possibly with a script) for OS X to create an
> alias on the user's desktop that links directly to the current user's AD
> home directory - like the one that appears on the dock, but on the desktop?
>
> Any ideas would be appreciated.
> Ben Slutzky
>
> _______________________________________________
> Casper mailing list
> Casper at list.jamfsoftware.com
> http://list.jamfsoftware.com/mailman/listinfo/casper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20080827/650bd613/attachment.htm 


More information about the Casper mailing list