+ Post New Thread
Results 1 to 2 of 2
Mac Thread, Working Apple Script to mount shares with logged in user Credentials in Technical; Below is an Apple Script I have done up that can be used as a login script to mount a ...
  1. #1
    Carter's Avatar
    Join Date
    Sep 2010
    Location
    Canada
    Posts
    269
    Thank Post
    10
    Thanked 66 Times in 41 Posts
    Rep Power
    20

    Working Apple Script to mount shares with logged in user Credentials

    Below is an Apple Script I have done up that can be used as a login script to mount a share. You can add multiple shares if you wish to the script.

    The script will poll for the logged in user/password then mount the share.

    All you need to replace in the script below is "Server" & Share" the left should be left as is.

    To test, if you login using an AD user or even an OD user then run the script you will see the share mount.


    Code:
    set MyName to do shell script "whoami"
    tell application "Finder"
    	mount volume "smb://SERVER/SHARE/" & MyName & ";" & MyName & ":password"
    end tell

  2. 2 Thanks to Carter:

    jsimpson (15th November 2010), Sean-OC04 (26th April 2013)

  3. #2

    Join Date
    Mar 2012
    Location
    United Kingdom
    Posts
    74
    Thank Post
    1
    Thanked 14 Times in 14 Posts
    Rep Power
    8
    Old topic but this was just what I was looking for (mounting shares never seems to work from profile manager).
    Can I ask though, how do you set this to be a login item? Profile manager only supports shells scripts so I wasn't sure where to add it

    Edit/Made a workaround, exported it as an Application and then added it to the login items. I can't now figure out how to add it to the dock though (in profile manager). All I can see is the stupid question mark
    Last edited by furby; 26th April 2013 at 12:15 PM.



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 1
    Last Post: 6th October 2010, 09:49 PM
  2. User credentials constantly required when accessing network shares
    By bertster in forum Windows Server 2008 R2
    Replies: 0
    Last Post: 22nd September 2010, 11:19 AM
  3. Apple Script and user auth
    By jamiess in forum Coding
    Replies: 0
    Last Post: 31st March 2010, 05:01 PM
  4. Remote desktop and user credentials
    By localzuk in forum Thin Client and Virtual Machines
    Replies: 0
    Last Post: 17th March 2008, 02:08 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •