-
All replies
-
Helpful answers
-
Jul 4, 2014 3:01 AM in response to Hector Castilloby AMI289,Hi Hector,
You are correct!
The problem is the spaces.
And William was correct as well, but he was only half-way right.
You see, as I've mentioned, "do shell script" runs the command like you type it in Terminal,
And as William said, in order the make a literal space, you need to put a backslash before it (meaning 'Office Users Folders' become 'Office\ Users\ Folders').
That way, the Terminal knows that this space is part of the same 'item' (as opposed to 'cd DIRECTORY' for example, which means, do the 'cd' command, for the next item, which in this case is 'DIRECTORY'.
The thing is, that on AppleScript Editor (and I believe that in almost program languages for that matter), you have a special 'code-operations' which starts with a backslash sign, so if you want to get literal special signs (such as backslash, double-quoutes, etc.), you need to put a backslash before that, so that AppleScript Editor will 'understand' that you want to put the literal sign, and not do a special operation.
So because you want to 'tell' AppleScript Editor that you want to put a literal backslash, you need to put another backslash before the one you already added.
So your network share point now becomes 'Office\\ Users\\ Folders').
Just replace the line in my example with the line below, and you should be good to go-
umount -f /Network/Servers/myoffice.server.private/Volumes/Data/Office\\ Users\\ Folders' > /Users/logouthook" with administrator privileges
Just a tip mate,
Before saving it as an Application,
Open AppleScript Editor on a client computer, paste the whole code to it,
On the bottom, go to the 'Events' tab (clicking it will show both 'Events' and 'Replies', if it doesn't, just click on 'Replies' as well)
And run the script,
Watch to see if you have any errors,
If not, you can then save it as an Application, and manually run it on all clients computers
Good luck mate,
Post back if everything is working, or if you need any more assistance
-
Jul 4, 2014 3:07 AM in response to AMI289by William Bowden1,Story of my life being half right well thats what the wife says. she gave me one the other day not she was wrong just gave me the argument first one in 32 years
-
Jul 4, 2014 3:50 AM in response to William Bowden1by AMI289,Congrats mate.
BTW, have you got the script working for you?
-
Jul 4, 2014 7:37 AM in response to AMI289by William Bowden1,Not had a chance life one big rush and complications, they also have multiple home volumes etc , need the will to do it
-
Jul 4, 2014 2:17 PM in response to AMI289by Hector Castillo,Hi AMI289,
Thanks for you response, I got script working now, but I am still having big issue I thought it would get fix with script working.
The issue I am having is if a Network User (1) logs in to client A machine, works for a while, logs out, Network User (2) logs in, works for a while and logs out, when Network User (1) logs in back again on all happening on Client A machine, as soon as Network User (1) opens mail app, it starts asking for mail password and it won't take the password, so I need to restart client A machine in order to fix the issue, Apple Care is aware of both issues, mail app keeps asking for password and users not disconnecting properly, they say somehow is not releasing the share point completely until machine gets rebooted, so I am wonder if you would be able to modify script so it releases everything.
Here is a post from me from a while ago,Mail keeps asking for password and icloud setting do not load in system preferences
Thanks for you help,
Hector
-
Jul 5, 2014 10:04 AM in response to Hector Castilloby AMI289,Hi Hector,
We're not using Mail feature on our server, so I haven't encountered it.
But after some reading, I understand that this problem is related to Keychain issue.
Try doing that-
Log in with network user A,
before logging out, click on Finder->Go->Go to folder and write ~/Library/Keychain
you should see a file with a long name of random numbers and letters,
Move it to trash,
Log out, connect with network user B, log out, connect with network user A again and try accessing the mail app.
Doing the above will delete the user's keychain file, which, if i'm not mistaken, will delete any saved password the user had,
Next run it will ask for the mail password again, but now it should accept it.
If it works for you,
And you are okay with using this kind of solution,
Tell me, and I'll tell you how to embed it with the original script.
-
Jul 6, 2014 12:35 PM in response to AMI289by Hector Castillo,Hi AMI289,
We are not using mail service on server app, we are just using mail app from each network user dock.
Can you please do that script if you don't mind, in case I decide to stop using script what would I need to do?
Thanks Again,
Hector
-
Jul 6, 2014 12:47 PM in response to AMI289by Hector Castillo,Hi AMI289,
By trashing the files (total of 3 file with a long name of random numbers and letters), before login out did not fix it, still keeps asking for password, I am sorry I should of test it before writing the above post, let me know what you think.
Thanks
Hector
-
Jul 6, 2014 11:07 PM in response to Hector Castilloby AMI289,Hi Hector,
Here's what I want you to do.
Do as you always do to get the password problem, i.e. log in as network user A, use the mail, log out, log in as network user B, log out, log in as network user A again and try to use the mail.
What I want you to look for in the error message, is which keychain is it referring to (login, local item, etc.).
Once you figured that out, restart the computer, log in as network user A, use the mail app.
But now, before you log out, go to Finder->Utilites->Keychain Access and from the list of keychains, go to the one that the error message was referring to before, and check to see if it is indeed there.
Log out, and log in as network user B.
Do the above search.
Check to see if you find only user's B keychain or you see user's A as well.
Log out, and log in as network user A.
Do the above search
If it doesn't appear in the keychain that the error message stated, look for it in other keychains and post back with the location you found it in.
Do this the same as the above, for user A, B, and then A again.
Post back your results and will see how we go from there.
Cheers mate.
-
Jul 8, 2014 12:53 PM in response to AMI289by Hector Castillo,Hi AMI289, I don't get any error message, it just keeps asking for password.
Hector
-
Jul 9, 2014 4:16 AM in response to Hector Castilloby AMI289,Hi Hector,
I think I might misunderstood you....
Which kind of password request are you receiving?
From the mail server, like this one-
http://kb.nsd.org/admin/attachments/Username.png
Or from the Keychain, like this one-
http://www.creativetechs.com/iq/tip_images/KeychainAccess-Password.png
** Images are courtesy of google search
-
-
Jul 10, 2014 1:37 AM in response to Hector Castilloby AMI289,Hmmmm.....
Well, I've got a couple of questions and couple of things I want you to do.
I'll number the questions so it will be clear which answer is for what questions, and also to make sure you don't miss any of them.
1) Are the mail servers your clients use are the same ones? (for example, all of them are gmail accounts), if they does, does this also occurs when using network accounts with different mail providers (for example network user A has gmail account and network user B has yahoo account)
2) Do your clients need to set up their account on each computer, or once the mail account is set up on one computer, any other network computer your clients use already have their mail set up?
3) If you log in with network user A, use the mail, but don't log out, can you log in on a different computer using the same user account and use the mail?
4) If, when being requested for password, you go to System Preferences -> Internet Accounts and uncheck mail, opening and closing the mail app, then check mail again and trying to open the mail app, does it still ask you for your password?
5) If you go the System Preferences -> Internet accounts and delete the user mail account, and then setting the mail from there, and not directly from the mail app, does it make any difference?
6) Open Finder->Utilities->Console, what do the console prints when you receive the error message? (you can copy-paste the lines here or save them to text and attach them)
Cheers
-
Jul 10, 2014 9:02 AM in response to AMI289by Douglas155,I'd like to chime in and report that I've had this issue since Mountain Lion and Mavericks has not fixed it. I still have locations using Lion because this issue causes so many problems. The script above does work, but it does something different than the restart does. Once the mount point is disconnected, the problem Hector describes happens. It is the result of losing access to the keychain. Any service that has a stored password will prompt for re-entry of that password, e.g. Calendar, Mail, Messages, Contacts, etc. Entering the password doesn't usually work either. A restart is needed. If you cancel the dialog request for a password, then restart the computer, and log back in, everything works as it should without having to re-enter passwords. If someone tried to type in a password while having the keychain issue, they will need to re-enter it once the computer is restarted and it will stick then.
Forcing an unmount does show the user as disconnected from the server, but something isn't right until the client is restarted.
I'd love to figure out what it is to build into the logout hook so that the machines don't need to be restarted every time someone logs out.
Doug
-
Jul 10, 2014 5:25 PM in response to AMI289by Hector Castillo,Hi AMI289,
Here are the answers to your questions.
1-Excaclty the same server and is not gmail for sure.
2-Only in one computer and automatically available on all clients machines.
3-No, first of all I have under workgroup manager unchecked to allow simultaneous login on managed computers. in the past when I had simultaneous login on managed computers checked, if Network User A was login to client machine1 and login to go to client machine 2 with Network User A credentials, could not use mail app.
4-As soon as I go to internet accounts it asks for password there to, and doing what you asked still keeps asking for password.
5-No difference
6-7/10/14 4:31:22.135 PM Mail[784]: Error finding an Internet password for joe@mymali123.com@imap.serverprovider.net: -25291
As Douglas 155 reports on his post above is having exact same problem, The script is releasing file share but that is not the entire problem.
Thanks,
Hector
