Posted on 11-10-2016 06:22 AM
Hi all, I am new to Casper and also to Mac scripting. I just want to mount as simple as possible our shared drives to the users Macs. I got an osascript running which works perfectly on the Mac itself.
Have imported it to Casper Admin, created a policy but it doesn't work. It states me an error:
Script exit code: 127 Script result: /Library/Application Support/JAMF/tmp/MountSharedDrives: line 2: tell: command not found /Library/Application Support/JAMF/tmp/MountSharedDrives: line 3: try: command not found mount: You must specify a filesystem type with -t.
Find below the osascript I wrote:
set userName to do shell script "whoami"
tell application "Finder"
try
mount volume "cifs://our.domain.com/abc/share/"
mount volume "cifs://our.domain.com/abc/music/"
mount volume "cifs://our.domain.com/abc/home/gt_home/" & userName & "/"
end try
end tell
Posted on 11-10-2016 06:28 AM
@bmgsupport you need to wrap that AppleScript in Bash to run in Jamf Pro. I use the script that @davidacland posted in this discussion:
I specifically use this script to provide different "Mount" buttons in Self Service for my users.
Posted on 11-10-2016 07:45 AM
@stevewood thanks for your swift reply.
It worked just once but now I always get the error like below:
Script exit code: 1 Script result: 36:44: execution error: Finder got an error: Application isn’t running. (-600)
Do you happen to know why?
Posted on 11-10-2016 01:26 PM
@bmgsupport sorry, I am not familiar with that particular error. When you say that it worked once, do you mean that you were able to run the script one time and then the second time it did not work? Or that you ran the script once, it mounted the first share and then errored out?
Posted on 11-11-2016 01:27 AM
We use a slightly modified version of this and it works extremely well.
Might be worth looking into?
Posted on 11-11-2016 04:36 AM
@mark.mahabir How do you use this script? Via a policy which autmatically maps the drives triggered by login or recurring checkin?
And you also need to wrap it right?
I need to clear up: The script mention by @stevewood works via SelfService, but not triggered by login or recurring checkin.
Its weird. I'll do some further investigating.
Thanks
Thomas