Is it possible to mount AD Share to finder as the user logged in?

Discussion in 'macOS' started by carterx, Aug 24, 2011.

  1. carterx macrumors member

    carterx

    Joined:
    Dec 4, 2006
    #1
    What I'm Looking For:

    I want users to be able to login with their AD accounts & with a script mount their AD home folder. The issue is I don't like how the OS X AD Plugin works. I don't want to mount the server, I want to mount the users share itself so they do not need to go digging for their share.
    Ideally I would like a share to be mounted directly to the users share. This way when everyone goes to save a file it will show up in the finder and they are not having to go through a structure of folders just to find their share.
    Without this when the users click on the server there are over 2,000 other user shares that they need to sift through to find theirs. Though the others are denied access it's a waste of time and hard for some to figure out where they need to go.



    What I Have To Work With:

    I have the below Apple Script which checks for the logged into users name then uses it to mount the share. It works but still mounts the "SERVER" no the "SHARE". Is there a way I can add to this script so that the "MyName" which is the users ID can be the actual mounted share in the finder?

    Thank you to everyone that can help with this!!!!


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

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #2
    I would forget about trying to pass along the user id and password. Simply use MyName to get them to the correct share and let OS X prompt them for their user name and password. They should only need to type it once if they save it to their keychain access when prompted.

    I found another applescript for this...
    Code:
    set user_name to last word of (path to current user folder as text)
    tell application "Finder"
        try
            mount volume "smb://" & user_name & "@server/" & user_name & ""
        end try
    end tell
    I'm not saying it's any better but it might contain clues to get the whole thing working. More here...
     
  3. carterx thread starter macrumors member

    carterx

    Joined:
    Dec 4, 2006
    #3
    Sorry mixed myself up with where I need to get it to mount. I can get it to auto mount to the desktop but not info the finder. If I want to find it through the finder I have to select the server which gives me the large path to sift through.

    If I can't find a way to force shares to mount into the finder. I can drag it into the finder "Devices" from dragging the share from the computer but can't have it automatically be in the finder.
     
  4. carterx thread starter macrumors member

    carterx

    Joined:
    Dec 4, 2006
    #4
    The machines are all frozen so the keychain does not really work. The computer gets wiped and back to it's original state after a restart. As for the script I have above it works beautifully and mounts the share but does not place it into the finder "Devices". If I can get this the problem would be solved.

    .
     

Share This Page