Get Windows Terminal Server Session-ID



  • Is there any way to get thru Qt the Windows Terminal Server Session-ID?



  • AFAIK not. This is very platform specific, so I think you have to use the Win API for that.



  • Yes, i sort of agree with you. But does Linux and MacOS not provide a multi-user environment?

    To get the Windows Terminal Server Session ID from native MS-API is not an issue for me, but what is the approach for Linux and MacOS?



  • Of course, both support multiuser environment.

    I don't know what a Terminal Server ID is and what information it provides, so I have no clue what the equivalent on a Linux/Mac box is. What do you want to achieve?



  • The Session-ID in Terminal Server is per session a unique number. I block multiple instances of my program thru shared memory, but I would like to add the session ID to the shared memory name to allow once per session and not just once per machine.



  • [quote author="Volker" date="1322786603"]Of course, both support multiuser environment.

    I don't know what a Terminal Server ID is and what information it provides, so I have no clue what the equivalent on a Linux/Mac box is. What do you want to achieve?[/quote]

    AFAIK, ther is not a Terminal server ID, it is a "Session ID". Typically, you have that on a terminal server, where multiple users can be logged ni at the same time. Windows 7 also supports multiple logged in users, but only part paralell (as they bust use the same console). So it's more the user session, which is also supported on Linux. But I don't know how to get a user session ID (token, whatever) on linux.



  • Yes, i think Linux and MacOS are pretty the same in that matter. Maybe someone can tell me how i can get the session identifier in Linux (Environment Variable or whatever)...



  • OS X is a bit special in that point. While it is a true multiuser OS, only one user can be logged in using the GUI at a given time. You can ssh to a remote Mac box, but you do not have access to the native GUI nor do you have an X Window system like networked GUI running on your local box. So, for native applications there's hardly a chance to be ran multiple times by different users (if you start it, it would pop up on the remote machine's screen).

    On Linux using X11 (and other Unixes too), you can log in remotely to a box and have the GUI running on your local machine. The remote session can be identified by the DISPLAY environment variable. But watch out: If you open two ssh sessions, you get two different values for the DISPLAY variable. You may want to look at the USER env variable too, it contais the Unix name of the user running the current session, it's always the same, regardless of how often you're logged in.



  • That is not really true, you can login in MacOS as well as Linux multiple times in parallel. They provide nowadays the feature to login with another user, without logout of the current user.



  • [quote author="Stefan Walter" date="1323093420"]You can login in MacOS as well as Linux multiple times in parallel. They provide nowadays the feature to login with another user, without logout of the current user.[/quote]

    But that is not the same as the terminal server session ID on windows



  • [quote author="Gerolf" date="1323093420"][quote author="Stefan Walter" date="1323093420"]That is not really true, you can login in MacOS as well as Linux multiple times in parallel. They provide nowadays the feature to login with another user, without logout of the current user.[/quote]
    But that is not the same as the terminal server session ID on windows[/quote]
    Thanks, yes that is correct. I know that the Terminal Server Session ID is not the same id as on Linux or MacOS.

    What i wanted to know is how to get any sort of id (numeric or alphanumeric) that is assigned per user session?



  • There is nothing that's guaranteed to be there.



  • [quote author="Volker" date="1323171149"]There is nothing that's guaranteed to be there.[/quote]
    Yes, that is what i already feared. Well, anyway thanks for trying to help in that matter.



  • In windows it's the session ID, as each logged in user has an own session (also multi logins on win7 have own sessions, but no terminal sessions).
    However that works on Linux etc.



  • [quote author="Gerolf" date="1323172406"]In windows it's the session ID, as each logged in user has an own session (also multi logins on win7 have own sessions, but no terminal sessions).
    However that works on Linux etc.[/quote]
    Yes, but is there any environment variable other way to distinguish Linux sessions?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.