login policy to mount smb share fails...need help parsing logs....

teodle
Contributor II

very simple mount volume applescript that works fine on "some" Macs (10.11.6), but now is failing to execute as a login trigger for "other" Macs.

The script works if I do it this way:

jamf policy -event login

On the JSS log for that policy, I'm seeing this (for actual logins, not when the policy is triggered manually with the jamf policy command). Can anyone tell me what this means?

Script exit code: 0
Script result: 2016-10-17 12:31:34.887 osascript[1506:10543] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2016-10-17 12:31:34.889 osascript[1506:10543] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2016-10-17 12:31:34.890 osascript[1506:10543] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2016-10-17 12:31:34.893 osascript[1506:10543] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data

4 REPLIES 4

RobertBasil
Contributor

Can you post your script?

teodle
Contributor II

the script works just fine when triggered manually. jamf policy -login
the script works just find if I paste it into Script Editor on the workstation, then compile and run.

It worked fine for months and months. But just in case there's something I need to fix it to make it compatible with changes to jamf binary, etc....here it is:

tell application "Finder"
    delay 3
    try
        mount volume "smb://*path-to-share-deleted*"

    on error
        delay 1
        try
            mount volume "smb://*path-to-share-deleted*"
        on error

            display dialog "There was an error mounting the Volume." & return & return & ¬
                "The server may be unavailable at this time." & return & return & ¬
                "Please call *phone number deleted* if the problem continues." buttons {"Okay"} default button 1
        end try
    end try
end tell

teodle
Contributor II

I just switched to mounting the share/volume using a Config profile. Seems to work just fine.

I have another script that's more involved for AD homes, which don't seem to want to automount anymore, but Config Profile payloads can't be scripts. What.

jhuls
Contributor III

I believe you need to use a launchagent to kick it off so it runs under the correct current user context if you want to do this as a script.