![]() |
Anzahl der Terminal Server Sessions auslesen
Hallo zusammen,
ich würde gerne die Anzahl der laufenden Sessions von einem MS Terminal Server auslesen. Optimal wäre, wenn dies remote ginge, lokal macht aber auch nichts. Hat jemand eine Idee wie das gehen könnte? Gruß, Alexander |
Re: Anzahl der Terminal Server Sessions auslesen
Hi,
ich denke ![]() Edit: Über Delphi kannst du mit Hilfe der ![]() mfg Leonard |
Re: Anzahl der Terminal Server Sessions auslesen
bin leider Anfänger :-( wie binde ich dies ein?
|
Re: Anzahl der Terminal Server Sessions auslesen
Zitat:
Die JEDI API Library hast du dir ja sicher schon geladen und entpackt. Such am besten mal nach der Datei JwaWTSApi32.pas um zu prüfen, ob du auch das richtige hast. Dann sorg dafür, dass Delphi die Dateien finden kann (Tools -> Umgebungsoptionen -> Bibliothek -> Suchpfad). Nun musst du die Datei in deine uses Klausel aufnehmen.
Delphi-Quellcode:
Wenn das alles geht, dann kannst du mit der Funktion WTSEnumerateSessions die Sessioninformationen abfragen. Hier überlasses ich es dir noch ein bissel zu basteln ;-)
uses
... JwaWTSApi32; Falls es nicht funktioniert, dann schreib mal was du versucht hast und wir sehen weiter... mfg Leonard |
Re: Anzahl der Terminal Server Sessions auslesen
super hab ich soweit alles gemacht, jedoch sagt er dann beim kompilieren:
JwaWindows.dcu nicht gefunden |
Re: Anzahl der Terminal Server Sessions auslesen
Zitat:
|
Re: Anzahl der Terminal Server Sessions auslesen
Da befinden sich nur:
*.inc *.pas *.html |
Re: Anzahl der Terminal Server Sessions auslesen
Zitat:
Trag das Verzeichnis in dem die Dateien liegen mal noch unter Tools -> Umgebungsoptionen -> Bibliothek -> Bibliothekspfad ein. Dann sollte es aber gehen. mfg Leonard |
Re: Anzahl der Terminal Server Sessions auslesen
hab ich, delphi findet auch dann die pas will aber beim kompilieren die dcu!
|
Re: Anzahl der Terminal Server Sessions auslesen
Das sollte so nicht sein...
Versuch mal Projekt erzeugen, ob das hilft. Sonst könnte ich noch das hier empfehlen: ![]() |
Re: Anzahl der Terminal Server Sessions auslesen
You have to choose between using JwaWindows (which is really a single unit containing all other Jwa units) or using JwaWtsApi32. I recommend using JwaWindows in your case.
Note that the Jedi security library (Jwscl) contains a ![]()
Delphi-Quellcode:
The Connectstate property can be used to filter specific sessions (eg only active ones), from the docs:
uses JwsclTerminalServer;
... var TS: TJwTerminalServer; TS := TJwTerminalServer.Create; // You should check for errors and/or exceptions (see [url=http://jwscldoc.delphi-jedi.net/JwsclTerminalServer.TJwTerminalServer.html]documentation[/url]) but left out here to shorten code TS.EnumerateSessions; ShowMessageFmt('%d Terminal Sessions', TS.Sessions.Count); TS.Free; ConnectState returns the connection state of the session. Which can be one of the following values: Session State Description WTSActive The session is connected, and a user is logged on to the server. WTSConnected The session is connected, but there is no user logged on to the server. WTSConnectQuery The session is in the process of connecting. If this state continues, it indicates a problem with the connection. WTSShadow The session is in the process of remotely controlling another session. WTSDisconnected The user is disconnected from the session, but the session is still attached to the server and can be reconnected at any time. WTSIdle The session is initialized and ready to accept a connection. To optimize the performance of a server, two default (idle) sessions are initialized before any client connections are made. WTSReset The session failed to initialize correctly or could not be terminated, and is not available. If this state continues, it indicates a problem with the connection of the session. WTSInit The session is in the process of initializing. |
Re: Anzahl der Terminal Server Sessions auslesen
JwaWindows erfordert etwas Vorarbeit. Damit JwaWindows.dcu erstellt wird solltest du diesem
![]() Die JWSCL erdordert dann nur noch den Quelltextpfad anzugeben : ![]() JwaWTSAPI32 einzubinden erfordert aber nicht JwaWindows. Denn JwaWindows bindet automatisch alle JwaXXX Units ein. Man sollte jedoch JwaWindows.dcu erstellen, da das Erstellen von JwaWindows.pas einige Zeit braucht. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz