I’m writing an application that runs as a system daemon (root session) for Mac OSX 10.6. As part of this application, I need to list all the active graphical login sessions.
There is an (undocumented, but public) function called SessionGetInfo which will give me more information about a session with a known session Id, but I need a function that tells me the active session Ids on the system.
The ultimate goal here is for the daemon application to launch an agent in each graphical user session.
If you’re on Mac OSX 10.5+, according to Technical Q&A QA1133: Determining console user login status you could use the
utmpxAPI.Some example code can be UTXplorer.
Hope this is helpful.