C# sample code to demo:
- Create a classic .NET windows service to monitor user logons.
- Impersonate the user's security context.
- Acquire user's credentials for single sign-on integration.
This sample extends the basic tutorial on creating a classic windows service app.
https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer