+ Start a Discussion
Sharankumar DesaiSharankumar Desai 

Apex Code to get Logged In users List

Hi All,

I am looking for an Apex code which can get me a list of all current logged In users.

Let me know if this is feasible.

Sharan Desai
+91 966 33 11 740
You can't do this in Apex I'm afraid. You can get at session information via the SOAP api :


So you could query all sessions that aren't considered expired - note that this doesn't mean that they are active.  You can access the SOAP API via JavaScript using the Ajax toolkit, so you would be able to get the list of users back to a Visualforce controller and thus into Apex, but you can't access the SOAP api via Apex in a supported fashion.
Sharankumar DesaiSharankumar Desai
Thanks Bob..