Query for Logged In Users?

One of our users runs a script in the evening to modify data. Once in awhile, they will receive an error that data is locked by user. I know that we can kick users by going into Help > Current Users, but I was wondering if there is a table containing this info? If so, I could create a script to alert the admin team in advance of the script that they can kick any users in the system.

For reference we are running Sage 300 2017. (Upgrading to 2023 in a few months)