Questions tagged [logoff]

106 questions
1
vote
1 answer

Read remote server event log to get AD user logon and logoff events and save it to SQL

Does anyone know how to get the user logon and log-off event logs from a SERVER 2012 Active directory into SQL server using C#? I would preferably run the service from a remote computer. Your assistance is appreciated!
JacoJ
  • 23
  • 2
1
vote
3 answers

remotely and programatically logoff an active domain user

I need to be able to logoff any user from his windows session from a program. I know I could log in as an admin and force a remote logoff. Is there any other way to force a logoff without logging in? The tool will run as admin so that's not a…
Vinko Vrsalovic
  • 330,807
  • 53
  • 334
  • 373
1
vote
2 answers

Javascript Windows Logoff - logoff.exe

I'm developing an HTA file and i"m trying to create a link in wich the user will be logged off when clicked. My function: function fn_fecha() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("C:\\Windows\\System32\\logoff.exe"); } and…
1
vote
0 answers

logoff winxp with windowservice C#

i want log off win xp by a condition in window service i use two method for them but not work pls help me 1.System.Diagnostics.Process.Start("ShutDown", "/l"); 2.[DllImport("user32.dll")] static extern bool ExitWindowsEx(int uFlags, int dwReason);
1
vote
2 answers

Working with a shut-down state of a user session on Windows?

Say, if I open a Notepad, type something in it and don't save it, then call the following API from the same user session: ExitWindowsEx(EWX_LOGOFF, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED); That user session…
ahmd0
  • 16,633
  • 33
  • 137
  • 233
1
vote
1 answer

MVC 3/ASPNET Auth - Almost Randomly Redirecting To Account/LogOff

This is a very strange one for me and I've been battling with it for a while now. I really hope someone can help. I have a fairly typical MVC 3 Website and I only seem to be getting this problem in IE and Firefox. Chrome plays along nicely. Lucky…
Ebbs
  • 1,030
  • 3
  • 20
  • 38
1
vote
3 answers

Sending system to sleep right after logging off users on a Windows system

I have a service application that runs in conjunction with a user-mode module. The software allows to perform a specialized power operation at which the user-mode code first logs ff the Windows user and right after that the service application puts…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
3 answers

Cross-browser windows forms logoff?

Looking for a cross-browser way to log a user off a webpage which uses windows authentication.
user1228
1
vote
1 answer

Error when quitting Excel and Logging Off

I need some help with Excel VBA (2010 on windows 7). What I'm trying to do is close Excel and then shutdown the pc. The code I have is: Declare Function ExitWindowsEx& Lib "User32" (ByVal uFlags As Long, ByVal dwReserved AS Long) Global Const…
rockOn123
  • 45
  • 1
  • 1
  • 7
0
votes
1 answer

DOS command to bring up "Turn off computer" window?

I would like to create a batch file that brings up the Windows "Turn off computer" window, rather than the user doing so through the usual Start / Turn off Computer method. Here's a picture of the window I would like to bring up using a DOS batch…
Martin
  • 43
  • 7
0
votes
1 answer

How does one programmatically add a logon/logoff/startup/shutdown script to a GPO via c#?

So I've been able to make use of the GPMC library to add GPO's and link them to OU's. However my program needs to be able to attach logon/logoff/etc scripts to the GPO User/Computer configuration. I could go and edit the scripts.ini file and then…
ymerej
  • 727
  • 1
  • 8
  • 21
0
votes
0 answers

VBScript to close windows, log off and log back on

I realize that this might sound ambiguous at first, but just hear me out. I need a vbscript to either run locally or remotely to close some windows (I have already done it locally with sendkeys) and I can log it off too. However, since a vbscript…
CalebM
  • 23
  • 1
  • 6
0
votes
0 answers

AutoLogoff 5/10 minutes after AutoLogon on Windows Server 2019

I am currently trying to use the Windows Server 2019 Task Manager tool to plan an activity. The activity should be the execution of C:\Windows\System32\logoff.exe 5 or 10 minutes after the user (Administrator) Autologon. Automatic Logoff should only…
0
votes
1 answer

Figure out which desktop is active at the moment from the Win service

I have a Win service running under the SYSTEM account. In case the user logs out from the system, the service should detect this and restart particular application on the logon desktop (and stop itself in case than user closing this application…
lfk
  • 57
  • 7
0
votes
0 answers

powershell code to remotely logg off a user session when a particular event ID is encountered in system logs

I am trying to write a script to remotely log off a user when a particular event ID is encountered. If a user connects a usb drive then event ID 2003 is generated in logs. How can I remotely log off that particular user remotely through powershell?