Jump to content
Server Maintenance This Week. ×

Where can I learn to create a system-level script


This topic is 3716 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

  • 4 weeks later...

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 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 3716 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.