Results 1 to 2 of 2
  1. #1


    Member Since
    Jun 23, 2011
    Posts
    2
    Applescript Q: Can you use applescipt to give mounted network volumes unique names
    Hi all,

    Through some digging (google) and trial and error, I have pieced together the following script that does what I want it to do.
    1) It asks the user for their username and password
    2) It authenticates that info with our domain
    3) It maps 4 windows network shares (DFS shares) for the user

    So my only problem now is that when the 4 drives map, 3 of them map with the same name because three of the paths that are mapped end in folders named after the username. Because of DFS and user rights, I canít map them a folder level higher, the path must end with their username folder.

    Thus I end up with 1 department drive and 3 username drive icons on the desktop, whereas I want to end up with 4 uniquely named drive icons on the desktop, to reduce end user confusion (work, department, posting, receiving).

    Assumptions:
    I would like this script to work for remote users who arenít joined to AD, so they would VPN connect to us, then run the script to map the drives. Again, this works now, just have the naming issue.
    I donít want to join the macs to the domain.
    I want to avoid aliasí if possible.
    I want to do this in a single script.

    So Iíd like to find a way to modify this existing script to rename mounted volumes to names that I choose. Right now the network icon on the desktop is named for the last folder in the path.

    Once you ďmount volumeĒ is there a way within applescript to then rename that mounted volume so the 4 icons that show up on the userís desktop each have a unique name?

    to getusername()

    display dialog "Enter your username:" default answer ""

    set username to text returned of result

    return {username}

    end getusername

    to getuserpwd()

    display dialog "Enter your password:" default answer "" with hidden answer

    set userpwd to text returned of result

    return {userpwd}

    end getuserpwd

    set userID to getusername()

    set userpass to getuserpwd()

    set Domain to "mydomain"

    # Map their Work drive

    tell application "Finder"

    try
    mount volume "smb://" & Domain & ";" & userID & ":" & userpass & "@server/work/" & userID
    end try

    end tell

    # Map their Department drive

    tell application "Finder"

    try
    mount volume "smb://" & Domain & ";" & userID & ":" & userpass & "@server/department/"
    end try

    end tell

    # Map their Posting drive

    tell application "Finder"

    try
    mount volume "smb://" & Domain & ";" & userID & ":" & userpass & "@server/posting/" & userID
    end try

    end tell

    # Map their Receiving drive

    tell application "Finder"

    try
    mount volume "smb://" & Domain & ";" & userID & ":" & userpass & "@server/receiving/" & userID
    end try

    end tell

  2. #2


    Member Since
    Jun 23, 2011
    Posts
    2
    Update: Looks like Lion may support DFS mappings (hoping it releases this month), so I'm going to wait to see how that works with WGM (workgroup manager) and I'll join them to AD if needed.

    While my script is still useful for mapping drives, it's not ideal for mass enterprise deployment and I'd still have my original problem of several mapped volumes with the same name.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 01-15-2012, 02:16 PM
  2. iPhoto '11 detecting Faces; not allowing me to give them names
    By jordanclark1993 in forum OS X - Apps and Games
    Replies: 0
    Last Post: 12-23-2011, 06:04 AM
  3. compare file names and move files applescript
    By carmolim in forum OS X - Apps and Games
    Replies: 1
    Last Post: 10-20-2010, 03:10 PM
  4. Replies: 0
    Last Post: 04-21-2008, 02:12 PM
  5. restricting access to shared folders/volumes on local network
    By nick_harambee in forum OS X - Operating System
    Replies: 1
    Last Post: 04-02-2007, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •