+ Post New Thread
Results 1 to 14 of 14
Mac Thread, Mac Login Scripts in Technical; Hi All I am looking to map 2 shared drives and and add the shortcuts to the desktop but I ...
  1. #1

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12

    Mac Login Scripts

    Hi All

    I am looking to map 2 shared drives and and add the shortcuts to the desktop but I have never done it before!!

    I have found this but I am a bit confused as to what to change? Macs drive mapping

    set MyName to do shell script "whoami"
    tell application "Finder"
    try
    mount volume "smb://server.school.local/" & MyName & "$"
    do shell script "ln -s /Volumes/" & MyName & "$ ~/Desktop"
    end try
    try
    mount volume "smb://server.school.local/" & "resources$"
    do shell script "ln -s /Volumes/" & "resources$" & " ~/Desktop"
    end try
    try
    mount volume "smb://server.school.local/" & "multimedia$"
    do shell script "ln -s /Volumes/" & "resources$" & " ~/Desktop"
    end try
    end tell


    Thanks Sted!!

  2. #2

    Join Date
    Mar 2012
    Location
    United Kingdom
    Posts
    70
    Thank Post
    1
    Thanked 13 Times in 13 Posts
    Rep Power
    8
    Just heading out the door but I use this to mount a shared drive, sure it could be adapted to add an alias to the desktop or just have Finder show "Connected servers". I'll have a play later

    Code:
    set MyName to do shell script "whoami"
    tell application "Finder"
    	mount volume "smb://server/sharename/" & MyName & ";" & MyName & ":password"
    	do shell script "ln -s /Volumes/" & "sharename" & " ~/Desktop"
    	
    end tell
    Edit- There you go, just edited and that works
    Last edited by furby; 27th June 2014 at 05:47 PM.

  3. Thanks to furby from:

    Hulbert99 (30th June 2014)

  4. #3

    Join Date
    Jun 2012
    Location
    UK
    Posts
    34
    Thank Post
    0
    Thanked 6 Times in 5 Posts
    Rep Power
    6
    If your users are logging in with there AD username and passwords you only need the Alias on the Desktop or in the Applications folder, when it is double clicked it will mount the share using there kerberos ticket.

    So mount the share on your mac, icon should appear on the desktop (if you have show connected servers turned on)
    Right click share name
    Select Make Alias
    Now copy Alias to all the Mac's you need
    Repeat for each share
    Job done

    Now all the users have to do it double click the Alias and the share will mount as needed.

  5. 2 Thanks to Mustang:

    Hulbert99 (30th June 2014), strawberry (30th June 2014)

  6. #4

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    Thanks both of you! Very helpful!

  7. #5

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    One last thing, if I am doing more than one share would it be like this?


    set MyName to do shell script "whoami"
    tell application "Finder"
    mount volume "smb://server/sharename/" & MyName & ";" & MyName & "assword"
    do shell script "ln -s /Volumes/" & "sharename" & " ~/Desktop"
    mount volume "smb://server/sharename2/" & MyName & ";" & MyName & "assword"
    do shell script "ln -s /Volumes/" & "sharename2" & " ~/Desktop"

    end tell

  8. #6

    seawolf's Avatar
    Join Date
    Jan 2010
    Posts
    969
    Thank Post
    12
    Thanked 286 Times in 218 Posts
    Blog Entries
    1
    Rep Power
    175

  9. #7

    Join Date
    Mar 2012
    Location
    United Kingdom
    Posts
    70
    Thank Post
    1
    Thanked 13 Times in 13 Posts
    Rep Power
    8
    Like that script seawolf, I've never really used scripts before, quite fun having a play with them. Still find it ridiculous that profile manger doesn't support applescript.

    @Hulbert99 You don't need the name and password the second time but I think you will need to remove and add them each time so;



    Code:
    try
    	do shell script "rm ~/Desktop/sharename"
    end try
    
    try
    	do shell script "rm ~/Desktop/sharename2"
    end try
    
    
    set MyName to do shell script "whoami"
    tell application "Finder"
    	mount volume "smb://server/sharename/" & MyName & ";" & MyName & ":password"
    	do shell script "ln -s /Volumes/" & "sharename" & " ~/Desktop"
    	mount volume "smb://server/sharename2/"
    	do shell script "ln -s /Volumes/" & "sharename2" & " ~/Desktop"
    end tell
    Last edited by furby; 30th June 2014 at 11:46 AM.

  10. Thanks to furby from:

    Hulbert99 (30th June 2014)

  11. #8

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    Sorry for bringing up an old thread but the above works brilliantly, but how would I also get the home drive to appear on the desktop?

    It loads on the bottom bar fine.

    Thanks

  12. #9
    ozydave's Avatar
    Join Date
    Jun 2007
    Posts
    268
    Thank Post
    88
    Thanked 37 Times in 25 Posts
    Rep Power
    33
    Quote Originally Posted by Hulbert99 View Post
    Sorry for bringing up an old thread but the above works brilliantly, but how would I also get the home drive to appear on the desktop?

    It loads on the bottom bar fine.

    Thanks
    I'm in the same boat. Loads on the bottom bar fine

  13. #10

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    I am also having problems getting it to run when a user logs in? as in i don't even know where to start...!?

  14. #11

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    I have tried doing this in terminal:

    sudo defaults write /Library/Preferences/loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Path" = "/Applications/Login"; "Hide" = "0"; }'

    But nothing happened. Do I need the extension of the script on the end?

    I created the script in AppleScript using the above and it works when I run it manually from the Applications folder.

  15. #12

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    I get this error



    2014-08-29 04:20:43.702 defaults[9942:507] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
    2014-08-29 04:20:43.703 defaults[9942:507] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
    2014-08-29 04:20:43.723 defaults[9942:507] Could not parse: { "Path" = "/Applications/Login.app”; "Hide" = "0"; }. Try single-quoting it.



    Any ideas please!?

  16. #13

    Join Date
    Mar 2012
    Location
    United Kingdom
    Posts
    70
    Thank Post
    1
    Thanked 13 Times in 13 Posts
    Rep Power
    8
    Are you using Profile Manager or Workgroup Manager?

    The home drive you just need to copy the sharename2 lines (remove and add command) and replace it with whatever you have set for the home folder in the AD. Mine for example would be "smb://deshawn/users$/" - Actually for some reason that doesn't work - hmm
    Actually that's not quite right - give me a moment.

    Slightly offtopic, forgot about this till today and had a bit more of a play. The script for laptop users now checks if they're connected to the right wireless SSID before it runs (or doesn't).
    Last edited by furby; 5th September 2014 at 11:20 AM.

  17. #14

    Join Date
    Jun 2009
    Location
    Arlesey
    Posts
    69
    Thank Post
    9
    Thanked 2 Times in 1 Post
    Rep Power
    12
    Honestly? I really do not know?! I have joined them to the domain if that sheds any light onto it?



SHARE:
+ Post New Thread

Similar Threads

  1. Installing/Copying Fonts from Login Script
    By mattpant in forum Windows
    Replies: 10
    Last Post: 11th August 2011, 10:24 PM
  2. Mac Login Script
    By gybe78 in forum Mac
    Replies: 2
    Last Post: 9th September 2008, 11:51 AM
  3. Problem with Home Drive and login scripts
    By ArchersIT in forum Windows
    Replies: 4
    Last Post: 11th July 2007, 01:17 PM
  4. Replies: 4
    Last Post: 23rd November 2006, 10:33 PM
  5. Login script problem
    By SpuffMonkey in forum Windows
    Replies: 55
    Last Post: 4th February 2006, 10:27 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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