Questions tagged [logoff]
106 questions
26
votes
6 answers
Log off user from Win XP programmatically in C#
How do I initiate a Windows XP user Log Off from a C# app? The action of my app should produce the same result as clicking "Log Off" in XP start menu -- it's fine if the system asks for a confirmation.
Is there a .Net or an unmanaged API for this?

dbkk
- 12,643
- 13
- 53
- 60
26
votes
4 answers
Get notified from logon and logoff
I have to develop a program which runs on a local pc as a service an deliver couple of user status to a server. At the beginning I have to detect the user logon and logoff.
My idea was to use the ManagementEventWatcher class and to query the…

Andre Hofmeister
- 3,185
- 11
- 51
- 74
13
votes
1 answer
Logoff interactive users in Windows from a service
I'm trying to figure out a way to log off users in local Windows sessions from a Windows Service written in C#.
Here's the background to the problem:
I need to manage the computer usage time of a set of users; when their allotted time expires I want…

multiSingularity
- 133
- 1
- 1
- 4
8
votes
3 answers
Logoff computer using java
How to use java to log off windows. It could be using some windows own exe through Runtime(),
or and other methods.It would be more efficient if you could provide some good alternative than using external programs like nircmd.exe .
When I use this…

meain
- 833
- 9
- 28
6
votes
4 answers
C# Windows application prevents Windows from shutting down / logging off
I have written a C# Windows Forms application, not a service (it is only used when the user is logged in and has a graphical user interface) that has a background thread running in an infinite loop.
When I try shutting down Windows (7) however, it…

arik
- 28,170
- 36
- 100
- 156
5
votes
3 answers
Windows logoff using Python
Which Python function should I use, to log off current user.
I found an example that is locking my pc, like Win+L combination
ctypes.windll.user32.LockWorkStation ()
but I need a similar function, which will log off.

vpalade
- 1,427
- 1
- 16
- 20
5
votes
3 answers
How does log off work in DNN 5.x?
We are seeing an issue where the Session isn't being abandoned in DNN. I'm not sure if this is was a 4.5.x issue as we upgraded a while ago to 5.x and maybe referencing an older control.
The login/logoff control we are referencing in our module is…

thames
- 5,833
- 6
- 38
- 45
5
votes
2 answers
Related Logon and Logoff events in Windows using Win32_NTLogEvent class
I'm trying to get the login and logoff events from the Win32_NTLogEvent class. To do it, I'm using the following WMI query:
PATH Win32_NTLogEvent WHERE "(EventIdentifier = 4648 OR EventIdentifier = 4647 OR EventIdentifier = 4634) And TimeGenerated >…

James
- 1,653
- 2
- 31
- 60
5
votes
2 answers
Adding a logoff script
I have some scripts that I would like to run every time a user logs off. I would like to create something that programatically sets up the logoff scripts. For example, an exe or a cmd file that can be executed to add the logoff script to the list of…

Loduwijk
- 1,950
- 1
- 16
- 28
5
votes
2 answers
Saving the time the user is logged on
In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off.
User clicks log off.
User session expires.
User…

Francisco Soto
- 10,277
- 2
- 37
- 46
4
votes
2 answers
Abort Windows log off from Java
I have an Swing application in which the user can create and save documents. The application is deployed as a simple Jar-file.
The primary target platform is Windows Vista.
If the user has on opened and non-saved document in the application and the…

Mattias
- 41
- 2
3
votes
2 answers
How to prevent browser back button after logout Aspnet Core
I have an ASP.NET Core web site with cookie authentication.
When I logoff, and then, when I click in the back button of the browser, I navigate to the last web page, and I don´t want that, I wan´t the user to be redirect to the login page to be…

jolynice
- 514
- 1
- 8
- 25
3
votes
2 answers
Keep node in running state even after user log-off
How to keep a node application running in windows even when user logs off?
Also how to keep running a node http-server even after user log-off?

Machau
- 31
- 1
- 4
3
votes
2 answers
How to schedule a windows task to be run at logoff
Good morning,
I'm working with a Windows 7 computer.
I would like my computer to warn me about something I may not forget, at every time I log off from my system.
In order to do this, I am thinking of the "Windows Task Scheduler".
However, in the…

Dominique
- 16,450
- 15
- 56
- 112
3
votes
1 answer
C# How do I log off a Citrix XenApp User Session?
Since there is absolutely zero documentation by Citrix on their SDK, I am documenting this here.
Using C#, how do I programmatically log a user session off?

Nathan McKaskle
- 2,926
- 12
- 55
- 93