Mount Network Share - Resource Kit Script

jafuller
Contributor

I'm using the latest from the October release of the Resource Kit to mount network shares. I need to use DFS and it isn't mapping (see attachment). The path is: starbucksamersettle sscdepartmentsit but as you can see it isn't showing that way in the error message. Is there something that I need to update to make this work?

Any direction is helpful. Thank you!
--
James Fuller | Starbucks Coffee Company | Technology Application Services | Application Developer

11 REPLIES 11

ernstcs
Contributor III

I got nothing then...sorry. =(

jafuller
Contributor

No problem Craig. Appreciate the reply.
--
James Fuller | Starbucks Coffee Company | Technology Application Services
| Application Developer
E: jafuller at starbucks.com | V: 206.318.7153 | F: 206.318.0155

tlarkin
Honored Contributor

How are you authenticating and is it SMB or AFP?

jafuller
Contributor

Authentication at login to Active Directory. It should map to SMB shares.
--
James Fuller | Starbucks Coffee Company | Technology Application Services | Application Developer

tlarkin
Honored Contributor

If you are using kerberos you can use MCX to automount the share. This is a bit tricky but once you get it working, all you have to do is use MCX in Casper and be done with it. So, in WGM I created a share point for my TIS group, and then set it to auto mount as the logged in user. It will create a com.apple.loginwindow.plist file in the user's home directory under ~/Library/Preferences. When I made the change I then read the MCX file from the command line:

/LDAPv3/127.0.0.1/Groups > mcxread tis loginwindow Key: DisableLoginItemsSuppression State: always Value: 0

Key: AutoLaunchedApplicationDictionary-raw State: always Value: ( { AuthenticateAsLoginUserShortName = 1; Hide = 0; "MCX-NetworkHomeDirectoryItem" = 1; }, { Hide = 1; URL = "afp://10.160.2.10/TIS"; } )

The bolded blue text above will auto mount the share by the inputted URL as the authenticated user. How you code this into MCX in Casper may be tricky and I am not 100% sure how to do it myself at this time. However, I'd be willing to help you figure it out where and when I can because to be honest, I'd like to know myself.

tlarkin
Honored Contributor

OK James...

I just did another export of MCX settings in WGM and it gave me this output:

<key>loginwindow</key> <dict> <key>Forced</key> <array> <dict> <key>mcx_preference_settings</key> <dict> <key>AutoLaunchedApplicationDictionary-raw</key> <array> <dict> <key>AuthenticateAsLoginUserShortName</key> <true/> <key>Hide</key> <false/> <key>MCX-NetworkHomeDirectoryItem</key> <true/> </dict> <dict> <key>Hide</key> <true/> <key>URL</key> <string>afp://myserver/sharepoint</string> </dict> </array> <key>DisableLoginItemsSuppression</key> <false/> <key>LoginUserMayAddItems</key> <true/> </dict>

If you change the red text to your server path and then use that to import in Casper I think that may do it for you and you no longer have to use scripts. Really, if you have Casper just download server tools on your Mac, configure it to look at the local directory services, use it to set group policy then use the dscl command to read/export/import mcx configurations and you can manage everything with out having to use scripts anymore. Then you can even add a composer snap shot, and make those plists self healing if need be, though you most likely won't

Let me know if this works

ernstcs
Contributor III

I've been using, since implementing 10.6 as it appears more reliable
there, the mountshares script from the ResourceKit. I've added it to the
JSS unmodifed and then labeled the parameters as one of the screens shows.

I create a new policy for login, add that script and then fill in the
needed fields, as in the other screen shows.

We have machines bound to AD only, and the authentication happens through
kerberos.

Craig E

![external image link](attachments/c68e914e5b824b5d8c6197f1ef689558)
![external image link](attachments/9f37702bab404bf487adf14dd9a4b492)

jafuller
Contributor

This is exactly how I've been trying to map, but the error that I posted
with the original continues to plague me. I need to use DFS though and
that seems to be where my issue is. I can run the script and mount the
SMB version of the share, but not the DFS version. DFS is preferred in
our environment to prevent broken mapping.

--
James Fuller | Starbucks Coffee Company | Technology Application Services
| Application Developer
E: jafuller at starbucks.com | V: 206.318.7153 | F: 206.318.0155

ernstcs
Contributor III

We don't use DFS and that's likely not supported for this method...

Craig E

jmclaughlin
New Contributor

The network share script is more static as it requires hardcoded values. This is what I've been doing.

[Image:Screen shot 2010-11-09 at 12.24.57 PM.png]
[Image:Screen shot 2010-11-09 at 12.25.02 PM.png]

John McLaughlin
Technical Support Specialist
Newton Public Schools

![external image link](attachments/ca568cb43eb64956b5e9afeb173cb957)
![external image link](attachments/849f3c275b8b4933a7e69e15ce854743)

jafuller
Contributor

The latest version of the script in the Resource Kit states the following:

# HARDCODED VALUES SET HERE
shareUsername="$3" #The username of the user to be used to mount the share
- leaving this to $3 will mount the share as the currently logged in user
authType="kerberos" #Valid values are "kerberos" (default) or "password"
password="" #Note this only needs to be set if authentication type is
"password"
mountType="smb" #The type of file share. Valid types are "afp", "smb", or
"dfs". DFS only supports the "kerberos" authentication method
share='' #The address of the share you are mounting - if left blank, the
script will search for the "SMBHome" attribute in the user record #Example Values: #SMB Share: smb://server.company.com/share #AFP Share: afp://server.company.com/share #DFS Path: server.company.comdfsroot arget

Anyone else use DFS with this script?

--
James Fuller | Starbucks Coffee Company | Technology Application Services
| Application Developer
E: jafuller at starbucks.com | V: 206.318.7153 | F: 206.318.0155