Yosemite Automatic Home Drive Mount

jamesdurler
Contributor

Hi there,

We are currently testing 10.10 and are experiencing the following problem.

Our macs are bound to AD and when they log in the UNC path from AD is used to mount the home folder. This worked fine in 10.8/10.9.

For some reason, the home folder is now not mounting at all in 10.10. All I am seeing is a question mark on the dock which would indicate a nil alias but it seems like the share is not mounting at all as I am not seeing anything in /Volumes/ . Is anyone else having similar problems with yosemite and the AD plugin?

46 REPLIES 46

neakins
New Contributor

Hi guys. As of this week I am rolling out 30 Macs for a cart for a programming lab. I need some help as I have never used Macs in any of my previous jobs. I need to map the home drives for the students but at this point I can't even get it set up to log them in on the domain. So I guess my question is twofold. 1) how to set it up so the different kids can log in using there AD credentials. 2) how to map their home drives so they can have access to them. I have seen the scripts you guys are posting and for a mac I don't even know where to post this script to have it run.

Sorry for being such a newbie.

davidacland
Honored Contributor II
Honored Contributor II

Hi @neakins

Although there are some advanced script methods in use, just as a starting point you may be able to get by without them. The basic steps to do what you're looking for are (on each Mac):

  1. Open /System/Library/Core Services/Applications/Directory Utility.app
  2. Click the padlock and authenticate as the local admin
  3. Double-click the Active Directory option to configure it
  4. Enter the AD domain name, check the computer name is as you want it to appear in AD and click "Bind..."
  5. Enter the credentials of an AD account that is allowed to join computers to the domain

In it's default state, the user will log in, create a local home folder and map the network home into the Dock at the bottom of the screen.

JKingsnorth
Contributor

@davidacland we are trying to use your script however cannot get it to work. The policy runs at login and returns that it completed saying.

"Script result: STARTING: User drive mount
Network share already mounted for"

We are trying to create a local home for a user on a Mac and then mount a Network Share for that user.

davidacland
Honored Contributor II
Honored Contributor II

Hi @JKingsnorth

It will be getting confused by the logging in user as Casper is running the script as root. If you change any instance of $USER to $3 in the script it should work ok.

JKingsnorth
Contributor

@davidacland IT WORKED! Thank you!

rahanna
New Contributor

@davidacland

Sorry that I'm new to scripting so I'm still trying to figure out where to put in or define our Domain and the location of the AD Home drive to update the SBMHome Attribute correctly ...

For example: Our Domain is ........................................ MagicCasper.com

Our AD User Home Folder is ................ Server-03FSHome$%username%

Appreciate if you can help us update the following two lines in the script to make it work ...

Thanks,

ShortDomainName=`dscl /Active Directory/ -read . | grep SubNodes | sed 's|SubNodes: ||g'`

adHome=$(dscl /Active Directory/$ShortDomainName/All Domains -read /Users/$USER SMBHome | sed 's|SMBHome:||g' | sed 's/^[\]*//' | sed 's:\:/:g' | sed 's/ ////g' | tr -d '
' | sed 's/ /%20/g')

davidacland
Honored Contributor II
Honored Contributor II

Hi @rahanna

The ShortDomainName line will read the domain that the Mac is joined to and save the short domain name or Netbios name as a variable. In your example it would be something like MAGICCASPER

The adHome line will read the logged in users record ($USER) looking for the attribute called SMBHome and it will save the value in the variable.

So as long as you are putting the Server-03FSHome$%username% value into the home folder section of the profile tab in user account properties in AD, the script will read from there.

The only other catch, running the script with Casper means it is executed as root, so $USER doesn't work. If you are running it as a login policy, you need to change $USER to $3.

Hope that helps.