首页 > 解决方案 > How can I determine the length a windows login took for a user?

问题描述

I am trying to accomplish two tasks. First I would like to determine the LENGTH it took for a user to login to a workstation (NOT WHAT TIME THEY LOGGED IN). IE the moment the user enters their credentials to the time the windows desktop is available for them to do work.

I know I can create a windows service and enable CanHandleSessionChange event then override the OnSessionChange method. When this occurs I could start a timer but the question would be when to stop? Maybe there is a system wide event for once the user profile etc has loaded?

Second task would be completing the same thing when a user unlocks the workstation. Once again I can hook into the OnSessionChange but am unsure when to stop my timer. In the second scenario I would assume the userprofile is not reloaded.

Lastly wanting to do this may seem odd but it is to record login times for accessing virtual desktops which can vary greatly with roaming profiles, group policy, etc. Wanting to be able to track down users that are taking an enormous amount of time to get to the desktop so I can troubleshoot the reason behind. I would be using C# in any code I create.

标签: c#windowsauthenticationwindows-services

解决方案


推荐阅读