Hi MarlonRicardo-8326,
The first step in configuring the policy mentioned above is to set the permitted logon hours for individual users. This can be done by following the steps given below:
Open Active Directory Users and Computers (ADUC).
Navigate to the user account for which the logon hours need to be restricted.
Right-click on the desired user account and select the Properties option.
In the Properties dialog box, under the Account tab, click on Logon Hours.
In the Logon Hours window, select the time duration for which logon is permitted and select the Logon denied option. The permitted hours are represented in blue and the restricted hours are represented in white.
Group Policy to Force Logoff Users after Logon Hours
After the permitted logon hours have been set for a user, the next step is to configure the group policy to disconnect users after their logon hours have expired. This can be done using the instructions given as follows.
Open the Group Policy Management Console (GPMC).
Right-click on Group Policy Objects and select the New option.
Enter an appropriate name for the new group policy (For example, Force Logoff) and click OK. Select the new GPO and add or remove users in the Security Filtering section.
Right-click on the GPO and click Edit.
Navigate to Computer Configurations > Policies > Windows Settings > Security Settings > Local Policies > Security Options.
From the right pane of the console, select the Network security: Force logoff when logon hours expire policy.
In the Security Policy Setting tab, select the Define this policy setting checkbox. Select the Enabled option and click OK.
Thus the users who are logged in after their valid logon hours will be disconnected from their sessions with the SMB server.
As a result, users are automatically logged off when their logon time expires.
--If the reply is helpful, please Upvote and Accept as answer--