Auto mount network share

Discussion in 'OS X El Capitan (10.11)' started by GIZBUG, May 19, 2016.

  1. GIZBUG macrumors 65816

    GIZBUG

    Joined:
    Oct 28, 2006
    Location:
    Chicago, IL
    #1
    How do i automount a network share? I don't want finder popping up every time i reboot my iMac.

    Suggestions?
     
  2. Cascades42 macrumors 6502

    Joined:
    Jan 25, 2016
    Location:
    UK
    #2
    I know there is an app called Mountain which can do this. I've not used it unfortunately, however there is a free trial.
     
  3. KALLT, May 19, 2016
    Last edited: May 19, 2016

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #3
    You could create a workflow with Automator. Just create an application with it, add ‘Get Specified Servers’ and ‘Connect to Servers’ to the area and add the URLs of your network shares. If authentication is required, you could add this to the URLs. Afterwards you just put the application somewhere safe and add it as a login item in System Preferences.
     
  4. HenryAZ macrumors 6502

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #4
    Mount the share. Open System Preferences/Users & Groups, go to your user's "Login Items", and drag the share from the Finder sidebar to your Login Items.
     
  5. VictoryHighway macrumors member

    VictoryHighway

    Joined:
    Jun 22, 2008
    Location:
    Hopedale, MA
    #5
    Yes, but doing that always pops up a finder window for each share at startup, even if you click the hide option. This worked correctly in one point update a long time ago (10.5.8 I think), but has been broken ever since the following point update.
     
  6. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #6
    If you find an answer- please post it. I've been looking for a way to do that since I switched to Macs back in 2007.
     
  7. VictoryHighway macrumors member

    VictoryHighway

    Joined:
    Jun 22, 2008
    Location:
    Hopedale, MA
    #7
    I just use an AppleScript, that I compile into an Application, and then launch that from the "login items." This is the script:

    Code:
    -- Define username
    property username : "yourusername"
    
    -- Define shares
    property mapdrive1 : "smb://" & username & "@yourserver/Share1"
    property mapdrive2 : "smb://" & username & "@yourserver/Share2"
    property mapdrive3 : "smb://" & username & "@yourserver/Share3"
    
    -- Mount Volumes
    mount volume mapdrive1
    mount volume mapdrive2
    mount volume mapdrive3
    
    Replace SMB with AFP or NFS if you're using either of those protocols.
     
  8. steve23094, Sep 22, 2016
    Last edited: Sep 22, 2016

    steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #8
    I have tried this and it looks like it works well.

    When I run the script the dialog box pops up requesting the network drive user password. I have the password saved in my Keychain so all I have to do is press Connect. But is there a way to automatically parse the password through so that's not necessary? I presume it would be a weakness in security because somebody could see the password in my script, but I figure if somebody has access to my Mac's user account I have bigger problems than a visible home network drive password.

    EDIT: I think I know what to do, I'm just not sure where to put the quotation marks. I think I want it to look like this:-
    Code:
    smb://username:password@servername/sharename
    
    I have:-

    Code:
    -- Define username
    property username : "yourusername"
    property password : "yourpassword"
    
    -- Define shares
    property mapdrive1 : "smb://" & username & ":" & yourpassword & "@yourserver/Share1"
    
    -- Mount Volumes
    mount volume mapdrive1
    
    EDIT2: But that definitely doesn't work, error message is There was a problem connecting to the server "yourusername"
     
  9. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #9
    Keep us informed if you get it working....I've been looking for something like this for years
     
  10. steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #10
  11. steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #11
    Check out the ControlPlane app (http://www.controlplaneapp.com), it's pretty good. It won't solve pressing Connect but you might find it very useful to trigger automatic mounts (and lots of other stuff besides). I read about it in another thread when I was trying to find a solution to this problem.
     
  12. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #12
    Looks interesting but I wonder if it'll be compatible with Sierra
     
  13. steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #13
    Yes, it definitely is. I'm using it now with Sierra to auto mount my network drives (I still have to press Connect though) and run my VPN app. I have set both up only to process when I have my WiFi link up. Sometimes it takes a while for my WiFi to connect after boot and other methods to achieve these two things end up timing out.

    I'll probably figure out other cool things to do with it, I only started using it earlier today.
     
  14. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #14
    Well...if you still need to hit "connect", I might as well stick with my method of putting the mounts into my login items. I have to close the folder window that pops up when they're mounted, but it's either a click on the close button, or a click on the "connect" button. Still no ideal solution.
     

Share This Page