1 of 1 people found this helpful
BE_ExecuteSystemCommand ( "/usr/local/bin/fmsadmin -u USER -p PASSWORD list clients" )
which fmsadmin to get the fmsadmin path
I have the feeling that it worked without /usr/local/bin/ before latest FMS 14v4a (seemed to work on 14v2)
I don't know that the fmserver user that runs server side scripts will have permissions to access the fmsadmin file. Check the BE error or possibly the console log to see what errors occur.
We may have alternate options in the beta available to sponsors. Contact me off list for details.
Thanks Vincent, and Nicholas. I tried the PSoS and it returns the correct value back in the script result to the client. Awesome!
I wrote a quick little file called Online.fmp12 that works with Perform Script on Server to get the list of clients logged into the server. It was made for Mac OS X and tested on 10.11.3 with FMS 14.0.4. It requires the Base Elements plugin and I used version 3.1.2 to test it. It would need a little modification to run on a Windows Server, but wouldn't take much work. I just don't have a Windows server ready to test on right at this moment. But it will work fine on a FileMaker Pro client on Windows if the server is Mac OS X. It only works on the server and not locally since the call to the OS for the FMSADMIN command must be on the server.
But here it is and it works! Now I can see in a FileMaker Pro client who is logged on to the server by running a FileMaker script without having to go to the Admin Console.
Online.fmp12.zip 70.0 K
Here is version 2 of the file that fixes an issue with special characters in the Computer Name such as a curly apostrophe (e.g., "John Doe's iMac").
Online.fmp12.zip 72.8 K
Trying to implement this on a Windows FMS 15 server and am having trouble.
If from the windows server in terminal I type in fmsadmin.exe -u [user] -p [pw] list clients -s
I get the list of current FMS users logged in. This tells me I can do what I want.
If from a FileMaker script I set the $command to the following I get nothing back:
"cmd.exe /c c: \Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe -u " & $User & " -p " & $Password & " list clients -s"
The $online variable gets no value. I confirm this by having the PSoS create a new record in the Online table and paste the value of $online. I also have the PSoS create a new record with the value of BE_GetLastError and it comes back with a 0, no error.
Thinking I have something wrong with the value of $command I tried the following:
"cmd.exe /c fmsadmin.exe -u " & $User & " -p " & $Password & " list clients -s"
This was a bad idea as it caused the script to hang waiting for the PSoS and caused excessive server activity. I disconnected myself from the server using the the server console and immediately the server activity dropped back to normal.
From the terminal I then typed in
c: \Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe -u [user] -p [pw] list clients -s
and the terminal simply goes to the next line, returning nothing back.
Any idea what the proper string should be for the BE command or how I could troubleshoot it differently?
I did this on Windows and it had a certain syntax. I do not recall if I had to the terminal as an admin. I am not able to fetch this right away but I will get to it when I can.