4
There are standard solutions available to solve this problem by Itzik Ben-Gan and others.
There is a question over the precise meaning of "maximum number of concurrent logged in distinct users". If this means that each user might have multiple concurrent sessions, and you only want to count one p...