Re: close a user session

Posted by webmaster Guido on November 06, 2003

In Reply to: Re: close a user session posted by giovanni caramia on November 05, 2003

: : : How can i close an/all open user session on Win2000 server programmatically in Delphi7?
: : --------
: : I've been searching quite extensively... but I can't find an answer to your question. Sorry.
: : I shall investigate some more and when I find something, I'll let you know.
: ::----------------
: ok, thanks.
: Really my problem is that My program runs (on the server win 2000) in night and pack files. Some users forget to close their pc and, more, they leave programs and files open. How
: can i close their sessions before my pack and reindex and copy begins?
: If possible i prefere to include in my program (in D7)instructions for close all open users sessions.
: At the moment a solved by scheduling a shutdown/reboot before my scheduled program.

Info about session-related API-functions can be found in the "Win32 Programmer's Reference" help file:

NetSessionEnum: provides information about all current sessions.
NetSessionDel: ends a session between a server and a workstation.
NetFileEnum: supplies information about some or all open files on a server, allowing the user to supply a resume handle and get required information through repeated calls to the function.

For starters, you could look up these functions and related topics in the Win32 API help-file. If you don't have or don't find that Help-file, just let me know and I'll arrange that you can download it.

From what I've seen until now, it's quite complicated stuff, and I can't find any code examples. A few links to give you an idea:


Related Articles and Replies:

[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]