Solved

Mount network drive on users desktop based on user name

Posted on 2011-09-20
2
656 Views
1 Endorsement
Last Modified: 2013-11-11
I need to give users access to their network folder on their desktops. Currently the users share folder is mounted to their dock when they log in, although I am not sure how it got there. I did not setup this network and according to WGM this dock item is not being controlled by it. The users authenticate to an AD server, which has executes a bat file for the users who log into the windows machines to mount there users network folder. This should not effect the apple computers tho.

So basically what I need is that dock item to end up on the desktop. Unfortunately programs, such as photoshop, will not allow you to save directly to that mounted drive since it is in the dock. It requires you to click the server name then the navigate through all the sub folders (around all the other users folder) to find your own folder.

So basically I need a folder that belongs to USER1 mounted on the desktop of USER1 when logged in and a folder for USER2 to be mounted on the desktop of USER2 when logged in etc....


Thanks


o and the server is 10.5.8 the clients in question are 10.6.8
1
Comment
Question by:bbayachek
2 Comments
 
LVL 39

Accepted Solution

by:
Eoin OSullivan earned 500 total points
ID: 36581954
Sounds like you need an AppleScript to auto mount the network share .. you could prompt for the details to test it first .. the following AppleScript should mount the user_name folder.
Edit the following code in Script Editor in OSX to replace the SERVERNAME/PATH with the correct path to your network folder containing the user home folders.

set user_name to ""
set Dialog_1 to display dialog "Please enter your user name" default answer "abc0001"
set the user_name to the text returned of Dialog_1
end
set pass_word to ""
set Dialog_2 to display dialog "Please enter your password" default answer "" with hidden answer
set pass_word to the text returned of Dialog_2
end

tell application "Finder"
try
mount volume "smb://" & user_name & ":" & pass_word & "@SERVERNAME/PATH/" & user_name & ""
end try
end tell

Open in new window


Then you could replace the 2 dialogs that prompt for the username & password and either just pass the user_name (in which case the user would have to re-enter the password to complete the mounting of their drive on logon) or hard-code the password for that user.

To get the user_name of the currently logged in user use the following line
set user_name to do shell script "whoami"

Open in new window

Unfortunately you cannot get the pass_word this way.

Save the AppleScript as an Application or Automator Script and put it in the login items or set as a startup script using a tool such as Lingon

0
 
LVL 1

Author Comment

by:bbayachek
ID: 36892034
Hmm, that may not be a horrific idea. Turns out apple is telling me I need to have the sharepoints setup up in order for work group manager to do this for me. Unfortunately our windows server is already setup and our current user folders are on a windows server. I am not sure if I can setup the windows folders to the mac server as sharepoints. I am going to look further into this. Ofcourse apple would not touch that with me since it is windows. I will try that script tho, It may be a good interim solution or the solution. I will get back to you with what I find.


THANKS!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will cover some tips for successfully installing the new update to OS X; 10.5.7. Although the information contained within could be used for any OS X point release.  Please note that this information applies to point releases to a parti…
In certain circumstances, a Microsoft Office mac application may fail to save a document to a network server, with the following error message: "There has been a network or file permission error. The network connection may be lost." An article at…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now