This is not a duplicate but refers to: Having trouble getting "Set action to take when logon hours expire" to work
There must be some test that can be done to determine if a user is logged in outside of their allowed logon hours otherwise the UserLock software wouldn't work. Or there is some event that gets logged when a user is logged in outside of logon hours.
I understand that the group policy that "force user to logoff" only closes active SMB sessions. Though I've found that if I remove a users allowed logon hours completely and they are still logged into a system they can access active SMB sessions and even create new sessions. Windows must not check logon hours every time a SMB share is accessed but instead every hour determine if that users hours have expired and then close open SMB sessions. Is there an event that is produced either on the server or on the workstation when this happens? Or is there any kind of test that determines if a user is outside of allowed logon hours?
Mind you, I've been looking for this answer for years now. I wonder if there is anyway to ask a programmer at MS.