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
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