c# - 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.
解决方案
推荐阅读
- android - 在导航中使用 TypeSafe 将多个 Agument 传递给片段
- asp.net-mvc - 将asp.net mvc项目从企业迁移到云端的最佳数据库策略(Azure优先)
- javascript - req.body 返回默认值,而不是我的 POST 请求
- javascript - 完美的滚动条:suppressScrollX:真的不在 rtl 模式下工作
- reactjs - 无法创建反应应用程序:npm 卡在“发现 0 个漏洞”
- javascript - 如果安装了应用程序或导航用户从 Web 应用程序播放商店,如何打开 android 应用程序
- ios - Firebase 崩溃日志未报告 IOS React Native 应用程序
- c# - 如何从 SQL Server 中的两个表中获取不同的行
- java - 用于将列表转换为此数据结构的 Java 递归函数
- xaml - 如何动画缩放视图以适应屏幕尺寸?