|
|
#121 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
it is mounting the share in volumes but that does not display in the output of SMBHome command. I don't know if there is any command that will display the AD home folder path in it's mac format /Volumes/Sharename/Username
I will need to use the the output of the SMBHome command to replace the backslashes but forward slashes and replace \\servername with /Volumes |
|
|
|
|
|
#122 | |||||||||||||||||||
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
I found this article on changing the mount style in OD, to use AFP for SMB shares.
Source: http://www.mactech.com/articles/mact...ory/index.html This article is a bit older but it still may hold true
__________________
sudo make me a sammich |
|||||||||||||||||||
|
|
|
|
|
#123 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
I have tried this in the past but had a lot of problems. smb home folders work perfectly so I am very hesitant to change this.
|
|
|
|
|
|
#124 |
|
Major Leaguer
Join Date: Jul 2003
Posts: 329
|
If you simply type the mount command into a terminal you will get a lot of rubbish but one of the lines will be the path to the H drive in MacSpeak.
All you have to do now is to extract that one line. Simple! On a serious note, I have found that you don't have to use AWK to get the currently logged on user. I have tried and it seems to work OK, the command logname. Does the same but is a bit neater. So my script is now :- #!/bin/sh me=$(logname) /bin/ln -s /Volumes/St*/$me /Users/$me/Desktop/$me"'s H Drive" Last edited by kaptagat; 03-19-2010 at 12:08 PM. |
|
|
|
|
|
#125 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
the mount command did show the volume name (/Volume/servername) but did not show the path to the home folder. However, this could be useful if there was someway to extract the path of the share and use it along with the currently logged in user's username. If this were possible I could write the command for the symink to look something like this...
/bin/ln -s $server/$me /Users/$me/Desktop/$me"'s Network Drive" The problem is how do I extract just that bit of the output and then define it as a variable in the script? |
|
|
|
|
|
#126 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
what does the command df output once the home folder is mounted? I really wish someone who has AD would come here and save the day, let me see if I can track down someone to verify this stuff since I don't use AD.
__________________
sudo make me a sammich |
|
|
|
|
|
#127 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
here is the output, the last line shows the path to my server share but not the home folder which would be /Volumes/ecserver/lenhartj
Last login: Fri Mar 19 10:28:57 on ttys000 TECH-IMAC:~ lenhartj$ df Filesystem 512-blocks Used Available Capacity Mounted on /dev/disk0s2 487725344 156574008 330639336 33% / devfs 214 214 0 100% /dev map -hosts 0 0 0 100% /net map auto_home 0 0 0 100% /home map -fstab 0 0 0 100% /Network/Servers //lenhartj@edcenter2.rlasd.k12.pa.us/ecserver 622839984 197926424 424913560 32% /Volumes/ecserver |
|
|
|
|
|
#128 | |||||||||||||||||||||||
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
It is mounting the share to /Volumes/ecserver You can wild card or variable from here
__________________
sudo make me a sammich |
|||||||||||||||||||||||
|
|
|
|
|
#129 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
OK, how would I do that using the script I have now?
me=$(ls -l /dev/console | awk '{print $3}') /bin/ln -s /Volumes/sharename/$me /Users/$me/Desktop/$me" 's Network Drive" I have next to no knowledge of the command line so I'm sorry if my question seems obvious. I'll need to wildcard or variable the /Volumes/ecserver part of the output and concatenate that with the $me variable to create the full path to the home folder. |
|
|
|
|
|
#130 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
Are your home folders nested with in that share or at the root of the share? Wild carding is probably a bad idea, we can just use variables. I just brought up wild cards because someone mentioned that you have different home folder paths on different servers, which could be an issue, but a wild card would get past that. I wouldn't call it best practices though.
__________________
sudo make me a sammich |
|
|
|
|
|
#131 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
they will be at the root of the share in every case
The name of the server would be different for each building but if we are pulling the path from the df command it would map to the correct share depending on the currently logged in user Last edited by lennysweet; 03-19-2010 at 12:53 PM. |
|
|
|
|
|
#132 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
OK, I think I've got it! I was playing around with different variations of my login script and finally found one that works. It can be used at all of my sites and simply looks one by one through any mounted volumes for a folder that's the same name as the user who's logged in. The only way it wouldn't work is if you have two separate volumes mounted with two different folder inside that are the same name but that's a rarity I know I won't run into. I hope this will help someone out there who is trying to do the same thing.
#!/bin/sh sleep 3 me=$(ls -l /dev/console | awk '{print $3}') /bin/ln -s /Volumes/*/$me /Users/$me/Desktop |
|
|
|
|
|
#133 | |||||||||||||||||||||||
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
You don't want to wild card it that way, it will wild card through all volumes... ln -s /Volumes/ecserver/$me /Users/$me/Desktop/homefolder
__________________
sudo make me a sammich |
|||||||||||||||||||||||
|
|
|
|
|
#134 | |||||||||||||||||||||||
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
I have to use the wildcard, otherwise it wouldn't work with any other building network shares. I already had the path you described in my original script but it was limited to users who mapped to /Volumes/ecserver, by using the wildcard it looks and finds the correct network volumes and creates a shortcut to the first valid path it finds. It didn't seem to do any harm, is there a reason I would not want to do this other than the rare case of having two folders with the same path? |
|||||||||||||||||||||||
|
|
|
|
|
#135 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
Food for thought, you may in the future want to migrate all your home folders to a share point called, homes or something similar. Since OS X will always mount the share point as /Volumes/sharepoint.
I have about 30 servers at my work, all of them hosting a good number of home folders. On each server I create a separate share point called "homes" and then nested sub folders for user groups. Therefore, I know that no matter what, when I mount a home folder it will always be mounted as /Volumes/homes, because it is it's own share point. Now, is there anything we can do, to tell what server the home belongs to? By subnet, by client name, or perhaps even something on AD?
__________________
sudo make me a sammich |
|
|
|
|
|
#136 | |||||||||||||||||||||||
|
Hall of Famer
Join Date: Apr 2002
Posts: 3,315
|
No, no other reason. [i.e., as you said: the wildcard is fine and facilitates matters quite nicely... the only downside being if more than one possible match exists. If you know that condition won't occur, then the outcome will remain predicable. If more than one match ever becomes possible, then that will result in both (or however many) matches appearing as extra arguments after ln -s in the command. [the way that ln will react to those multiple args will depend on whether the last arg is a valid folder or not. So long as that never happens though, wildcarding is fine... provided that one match does exist, natch.] |
|||||||||||||||||||||||
|
|
|
|
|
#137 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
Just a follow up, I was able to take this a step further by having a shortcut automatically created on the user's sidebar in finder under places. This is much better than a symlink on the desktop. I hope this helps someone out.
me=$(ls -l /dev/console | awk '{print $3}') open /Volumes/*/$me osascript -e 'tell application "System Events" to keystroke "t" using command down' |
|
|
|
|
|
#138 |
|
Major Leaguer
Join Date: Jul 2003
Posts: 329
|
I have been looking into manipulating the output of the dscl command which some people may find useful.
If you pipe the output to a file :- dscl . read /Users/abc1 SMBHome > home.txt The file then contains : SMBHome: \\CRWNSTAH1\Staffh\abc1 Then awk '{gsub(/\\/,"/");print}' home.txt will return SMBHome: //CRWNSTAH1/Staffh/abc1 (simply replaces \ with /) Also awk '{gsub(/\\/," ");print $3}' home.txt will return only Staffh (this replaces "\" with " " (a white space) so Staffh becomes the 3rd field of the string. Now one can set this to a variable and use it in a script. |
|
|
|
|
|
#139 |
|
Prospect
Join Date: Feb 2010
Posts: 20
|
We've added in a symbolic link to the script at startup which adds a folder on the desktop pointing to the users AD home folder.
the local profile is deleted when the user logs off. Just a question regarding the current documents folder. When the users load up the likes of microsoft word, when you click file -> save as, it defaults to the users documents folder. We could redirect this to a read-only folder, just so users wont have the ability to save into the documents folder. Is there a way to get MS word (or any other app) to default to another folder. We were originally going to redirect the documents folder (with a symbolic link) to point to the AD home folder, but there maybe certain users that dont have an AD home folder and would just assume that their documents folder was pointing to a server. It also clarifies (from our point of view) if the script actually runs at startup. if it runs, it creates the symbolic link on the desktop, if it fails to run or the AD share is unavailable, then the symbolic link will appear to be broken. Just wondering how other people are dealing with this? Are you just redirecting the documents folder to a read only folder on the local drive, or any other better suggestions? |
|
|
|
|
|
#140 |
|
Triple-A Player
Join Date: Jun 2008
Posts: 92
|
you can set the default save location in word settings and then move the word.plist file in the user template. New users will then grab those settings when they login. You can tweak almost any problem this way so users don't have to.
|
|
|
|
![]() |
|
|