Tip of the day: Query connected clients on FileMaker Server by script
# © 30.07.2016 Patrick Weh | Team Nifty GmbH (17:40 Uhr)
# List connected Clients
# ------------------------------------------------------------------------------------------------------------
# Script checks for connected clients at the FileMaker Server.
# Copy this File to your Server and run this Script on your FileMaker Server.
# ------------------------------------------------------------------------------------------------------------
#
Set Error Capture [On]
Allow User Abort [Off]
#
Set Variable [$r; Value:MBS( "RunTask.NewTask" )]
Set Variable [$r; Value:MBS( "RunTask.SetLaunchPath"; "/Library/FileMaker Server/Database Server/bin/fmsadmin" )]
# please put your admin password here
Set Variable [$r; Value:MBS( "RunTask.SetArguments"; "-u" ; "fmserveradmin" ; "-p" ; "fmserveradminpassword" ; "list" ; "clients" ; "-s" )]
Set Variable [$r; Value:MBS( "RunTask.Launch")]
# now wait for task to finish:
Set Variable [$result; Value:""]
Loop
Pause/Resume Script [Duration (seconds): 2]
Set Variable [$result; Value:$result & MBS("RunTask.ReadOutputText")]
Exit Loop If [MBS("RunTask.IsRunning") ≠ 1]
End Loop
#
# write into a field:
Set Field [Check clients::Clients; $result]
Commit Records/Requests [No dialog]
#