Waiting for NT Logoff

Hi,

In a Windows NT service, in response to a remote request from
another machine, I would like to do the following:

  1. Determine if any interactive user is logged in.
  2. If yes, log him off. Wait till logoff is completed.
  3. After logoff is completed, start a custom task.

Any ideas on how to accomplish 1 and 2. Any clues will be
appreciated.

Thanks in advance,
Niranjan Babu
Siemens.

Hi,

This excerpt is from KB

PSS ID Number: Q151424

Services can be notified when a user logs off a system but not when a
user logs on. A service receives a notification from the system by
installing a Console Control handler. The handler receives a
CTRL_LOGOFF_EVENT when the interactive user logs off the system. For more
information on Console Control handlers, please refer to the Win32 SDK
Online Reference.

A service can determine whether an interactive user is logged on by
determining whether the process specified in the following key is running:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\Winlogon

In this key, the process specified by the value shell is launched when an
interactive user logs onto a system. If this process is running, it
indicates that there is an interactive user logged on. To enumerate the
processes on a Windows NT system, the service needs to examine the Windows
NT performance counters. For more information, please refer to either the
TLIST sample on the Win32 SDK or the Win32 SDK Online References.

Additional reference words: 3.50 3.51 4.00
KBCategory: kbprg
KBSubcategory: BseService

HTH
Pamitha

-----Original Message-----
From: Babu Niranjan [SMTP:xxxxx@blr.spcnl.co.in]
Sent: Tuesday, September 12, 2000 4:17 PM
To: NT Developers Interest List
Subject: [ntdev] Waiting for NT Logoff

Hi,

In a Windows NT service, in response to a remote request from
another machine, I would like to do the following:

  1. Determine if any interactive user is logged in.
  2. If yes, log him off. Wait till logoff is completed.
  3. After logoff is completed, start a custom task.

Any ideas on how to accomplish 1 and 2. Any clues will be
appreciated.

Thanks in advance,
Niranjan Babu
Siemens.


You are currently subscribed to ntdev as: xxxxx@nestec.net
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

In a Windows NT service, in response to a remote request from
another machine, I would like to do the following:

  1. Determine if any interactive user is logged in.

Could use NetWkstaGetInfo() and get number of currently logged on
Users.

Hope that helps,
Michael Davis
Chief Technical Officer
Data Nerds, LLC.
http://www.datanerds.net

  1. If yes, log him off. Wait till logoff is completed.
  2. After logoff is completed, start a custom task.

Any ideas on how to accomplish 1 and 2. Any clues will be
appreciated.

Thanks in advance,
Niranjan Babu
Siemens.


You are currently subscribed to ntdev as: xxxxx@datanerds.net
To unsubscribe send a blank email to
$subst(‘Email.Unsub’)

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use http:

iQA/AwUBOb5YgviUqZ9dnoKsEQJpjQCdHZUpkCJ8QWfkawtI0H88LihfgmwAoOhM
9KWdFCHf8EcUMHdH3MW1p0tn
=edHg
-----END PGP SIGNATURE-----</http:>