473,804 Members | 3,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Windows Service, Detect Login

What will tell me that a logon event has occured in a windows service. I
don't need full credtitals just NT User Name.

Frank
Nov 17 '05 #1
2 5870
Frank,

The only workaround I can think of for this would be to place an
application in the startup directory for a user. Then, when the user logs
in, the application will start, and send a message to your service.

The only other way to do this would be to replace GINA.dll (which is
used on windows machines for authenitication purposes), but that requires
unmanaged code, which C# can not produce.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Frank Gibbs" <fr****@dev.nor ac.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
What will tell me that a logon event has occured in a windows service. I
don't need full credtitals just NT User Name.

Frank

Nov 17 '05 #2

"Frank Gibbs" <fr****@dev.nor ac.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
What will tell me that a logon event has occured in a windows service. I
don't need full credtitals just NT User Name.

Frank


On XP and higher you can use "local policies" to turn on "Logon auditing",
this will log the Logon event into the security eventlog. Your service can
then read the eventlog at regular intervals (and parse Message ID
551=Logoff, 528 = Logon) or, you can use System.Manageme nt's namespace
ManagementEvent Watcher and WMI to listen for security log events.
Another option, again on XP and higher) is the use System.Manageme nt's and
watch for Win32_LogonSess ion (WMI) instance creation events.

Willy.
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10335
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
5
8825
by: JohnFol | last post by:
I am using the Win23 API WNetCancelConnection2 and can sucessfully make a connection to a share within my class. The class is called from a Windows Form based test harness. When I instantiate exactly the samce class from a Windows Wervice, I get "A specified logon session does not exist. It may already have been terminated" .. The error number is 1312. I know the code to be good, so I suspect something around security / windows...
2
4931
by: Benoit Martin | last post by:
Is it possible to detect a mouse click from a .net service. I want a process running in the background that will detect when the user clicks the mouse button (anywhere on the screen) and executes an action accordingly. All the event handlers for the mouse that I see are for Windows Forms. Is there a way to do it without any controls on the screen? Thanks
4
2430
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
3
8549
by: Gary | last post by:
I am using VS.Net 2002 with windows 2000 advanced server and windows 2000 professional. I have a requirement to use windows service with a GUI. I want to show my own User Interface(Dialog) to get user input, before windows login screen. For that I have created a windows service, in the onstart event of this service, I am calling a vb.net exe, which has windows form. But it throws error bcoz of the form. I even tried by calling a vb.net...
3
3501
by: Evan Camilleri | last post by:
I have a problem for a Windows Service to login on an SQL server (different machine) - neither Windows Authentication nor SQL Authentication worked. LOGIN FAILED FOR USER sa (for example). If SQL Server is on the same PC of the Windows Service the connection works OK. The same code works in a Windows Form using same user and authentication methods to the SQL Server on a different machine.
2
5544
by: Eduard Witteveen | last post by:
Dear list, In the corporation, we want to know who is using which computer, and do some phone routing based upon this information. When a user log's uses it's account to login, the phone on the desk should also ring on the same desk. When the user leave's / sleeping, we dont want the phone to ring, so we want to detect this also. By using a service i can keep a program running, without irritating the users with icon's / message's at...
2
3104
by: arcade2084 | last post by:
I am trying to detect when a CD is inserted from a windows service. I have went through the route of creating a hiden window and trying to use the WndProc to detect the event; although the window does not seem to be recieving the events that I need. I have also tried registering the WM_SHNOTIFY event with my specific window and still do not recieve the event. Is there another method for recieving the CD insert event from within a winows...
0
9571
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.