February 7, 201411 yr I need to create and run a scheduled script (or script sequence) that will give me a list of what accounts are logged in, then change a field in a record for each account holder. Any resources anyone could point me to for learning how to do this?
February 7, 201411 yr This can probably be done. But what are you trying to achieve in the end here? There may be another way to get you the information you need. Steven
February 10, 201411 yr Would be helpful to know if you're on Windows or a Mac... You can use PSLoggedOn on Windows or Who or Users on Unix/Mac via a system level script to return a list of users logged on. You could then pipe this output to a text file and import this in to a global text field, and parse it in Filemaker to get a value list of logged in users. However, I'm not sure how you'd do this on demand as system level scripts are run as scheduled scripts on the server which you can't call from FMPro.. but you might want to look here for a way round this if you need this functionality: http://fmforums.com/forum/topic/85738-call-upon-server-to-run-a-backup-from-pro/ As Steven said, what's the end goal here?
February 11, 201411 yr Author Thanks for your replies. A little more info. This applies to a database running in FMS 13 on a Windows 2008 server. It is used exclusively by our staff via Web Direct. When a user logs in to the database, a startup script sets a field value to "ON" so other users can see who is currently logged in. An exit script clears the field, but that doesn't happen if the user times out or just closes the browser window. Ideally, I would get people to exit properly, but human nature makes that a losing battle. I want to set up a scheduled script on the server that periodically checks to see who is actually logged in, and then clears that field for those who have timed out. I can script the clearing of the field, but I need a way to to feed it which accounts are actually logged in. Hopefully this clarifies. Thanks again -- Victor
February 11, 201411 yr You can use PSLoggedOn on Windows or Who or Users on Unix/Mac via a system level script to return a list of users logged on. You could then pipe this output to a text file and import this in to a global text field, and parse it in Filemaker to get a value list of logged in users. That's the general idea but instead that of using PSloggedOn or its mac equivalent you need to use the fmsadmin command line. There is a switch to ask for detailed user info. Pipe that to a text file in the FMS documents folder and import it into a scratch table in your solution.
March 8, 201411 yr Author This worked well, with one glitch. It returns user name rather than account, which what I need to match. The user name is not always consistent with the field I can match. I can't find a command that will return the account name. Thanks for your help. -- Victor
March 8, 201411 yr The whole approach should be coupled with writing the OS account name to the FM prefs area and using external authentication. There are may variables to this. if you want a fool-proof way that uses the account name specified by the user on login then you need to use the Access.log that FMS keeps (but is not turned on by default). There is a lot more work in parsing that but it has all the details you need. I've shown how to do this about 7-8 devcons ago. Grab a copy of the access.log and learn how to parse it.
Create an account or sign in to comment