Skip to content

Instantly share code, notes, and snippets.

@bzerangue
Created November 15, 2011 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bzerangue/1367557 to your computer and use it in GitHub Desktop.
Save bzerangue/1367557 to your computer and use it in GitHub Desktop.
Mounting Microsoft Windows network drives on Mac OS X
## Mounting Microsoft Windows network drives on Mac OS X
##
## Steps:
## 1) Make sure your machine has already been setup to use Active Directory and that
## you are logged in as an Active Directory user.
## 2) Open Terminal and run the command id (Copy the gid value... example: gid=1005104282)
## 3) Open AppleScript editor and the code below (adjust for your settings)
## 4) To test the mounts, click Run and open Finder to see if they mounted
## 5) If the drives mounted, then save the script as a script
## (so you can edit it in the future if need be)
## 6) Then click on File Menu and choose Save As... (save the file as an Application Type)
## 7) Then open System Preferences,
## -- choose Accounts (Snow Leopard and Lower) or Users & Groups (Lion)
## 8) Click on the Login Items and click the plus sign button, add the application (not the script)
##
##
## EXPLANATION: This script is basically looking for the gid (Group ID of the Active Directory), if that
## gid value is there, it will run the following mounting script. If not, it will just end
## the script.
##
## NOTE: gid is the Active Directory, group ID; make sure to copy the 10-digit
## Make sure to replace the IP Address and gid values below you with your values
##
if (do shell script "id") contains "gid=1005104282" then
mount volume "smb://10.0.0.19/c$"
mount volume "smb://10.0.0.19/public$"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment