Call the GetRemoteSessionCount method to retrieve the total number of sessions on a database server. To get a total count of just the number of connected sessions on a database server use the GetRemoteConnectedSessionCount method instead.
This method is only valid for encrypted remote sessions connected as an administrator to the administration port on a database server.