Force unmount a network share?

Hello,

Since upgrading to El Capitan, network shares sometimes refuse to unmount. I get no errors, they just don’t want to unmount. I’d like to create an AppleScript app where I can drag the persistent share onto the app and have the app force unmount it. I’ve tried building a script but so far, I am not getting anywhere.

Can anyone provide an example?

Thank you so much,
hp

I was able to get this figured out:

on open theItems
repeat with anItem in theItems
set p to POSIX path of anItem
do shell script "sudo umount -f " & p user name “username” password “password” with administrator privileges
end repeat
end open