I am trying to write a small script to launch when user logs on. I have searched and got the script to work but unable to run at log on with .plist
We have active directory setup. When the user logs in using their credentials the script manually works once executed
tell application "finder"
set MyName to do shell script "whoami"
mount volume "smb://server/folder/" & MyName
end tell
or
set MyName to do shell script "whoami"
mount volume "smb://server/folder/" & MyName
and saved it as .scpt both manually works
Or i need to use it this way
tell application "Terminal"
set MyName to do shell script "whoami"
mount volume "smb://server/folder/" & MyName
end tell
save it as .sh
Now the plist is saved in /Library/LaunchAgents
:
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.script</string>
<key>ProgramArguments</key>
<array>
<string>/Users/Shared/SCRIPT.sh</string>
</array>
</dict>
</plist>
and do the following command
launchctl load /Library/LaunchAgents/com.script.plist
It does not work. Cant get the drive to auto-mount during logon
Please help. I am not a programmer so please be specific.
Thank you, Chris