@abimsft This question has been asked in the past about being able to obtain a list of users via a webPubSubTrigger. We reached out to the Azure WebPubSub product group for that question and the product group verified that this is not possible at this time.
As a result, I am unaware of how to achieve what you have proposed.
My suggestion would be to reach out to the "Azure Web PubSub Service Product Team" alias, and they might have further ideas on a workaround, or they might want to understand your use case better so they can understand the need for this capability and possibly consider a feature request.
Please let me know if you have any further questions or concerns on this topic or contacting the product group directly.