Jump to content

Recommended Posts

Posted

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? http://www.edugeek.net/forums/mac/46738-macs-drive-mapping.html

 

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!!

Posted (edited)

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

 

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 :)

Edited by furby
  • Thanks 1
Posted

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.

  • Thanks 2
Posted

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 & ":password"

do shell script "ln -s /Volumes/" & "sharename" & " ~/Desktop"

mount volume "smb://server/sharename2/" & MyName & ";" & MyName & ":password"

do shell script "ln -s /Volumes/" & "sharename2" & " ~/Desktop"

 

end tell

Posted (edited)

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;

 

 

 

try
[color="#0000FF"]do shell script[/color] "rm ~/Desktop/sharename"
end try

try
[color="#0000FF"]do shell script[/color] "rm ~/Desktop/sharename2"
end try


set [color="#008000"]MyName[/color] to [color="#0000FF"]do shell script[/color] "whoami"
tell [color="#0000FF"]application[/color] "Finder"
[color="#0000FF"]mount volume[/color] "smb://server/sharename/" & MyName & ";" & MyName & ":password"
[color="#0000FF"]do shell script[/color] "ln -s /Volumes/" & "sharename" & " ~/Desktop"
[color="#0000FF"]mount volume[/color] "smb://server/sharename2/"
[color="#0000FF"]do shell script[/color] "ln -s /Volumes/" & "sharename2" & " ~/Desktop"
end tell

Edited by furby
  • Thanks 1
  • 1 month later...
Posted

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

Posted
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

Posted

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.

Posted

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!?

Posted (edited)

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).

Edited by furby

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...