Restrict User Login to specific Time Frame on Azure AD

Mazi Bakhsh 36 Reputation points
2022-03-03T02:46:58.82+00:00

We are using Azure Ad and we do not have any On-Prem AD.
We want our users to be allowed to log in to our services in specific time frame like just during working hours (9:00-17:00)

How can we implement this policy on Azure AD.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Givary-MSFT 35,626 Reputation points Microsoft Employee Moderator
    2022-03-03T04:02:34.2+00:00

    @Mazi Bakhsh

    Thank you for reaching out to us.

    Unfortunately it is not possible to restrict user login to specific time frame on Azure AD.

    Azure AD / O365 does not 'understand' Logon Hours , you can leverage Block Sign in option if you want to block the user from accessing Azure AD.

    You may post feedback regarding this at the User Voice Portal ( https://feedback.azure.com/d365community ).

    https://feedback.azure.com/d365community/idea/ce83c644-bf25-ec11-b6e6-000d3a4f0789

    Let me know if you have any questions.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

  2. Vasil Michev 119.7K Reputation points MVP Volunteer Moderator
    2022-03-03T06:42:55.417+00:00

    Until Microsoft releases such controls for CA policies, your best bet is to periodically run a task (script, workbook, flow or whatever you use for automation) that blocks users and revokes any existing tokens. You can use PowerShell or the Graph API for this, but be warned that the user experience will be ugly.


  3. Nicolas INNOCENT 0 Reputation points
    2023-05-10T08:35:13.81+00:00

    Yes we also have this requirement, We need to be able to block our users to work during off hours, as this is becoming a legal requirement in France.

    The ability to block access to Teams and Outlook especially via policies would be the best way I think.

    The only way of doing this right now would be to use PS to block/release signin via automated tasks, but it doesn't actually work as, for example, once a mobile outlook is connected, it will not check revocation for a long while

    0 comments No comments

  4. Ben Koshy 5 Reputation points
    2023-09-17T22:22:59.7266667+00:00

    I need this too.

    People connect to my license server via Azure AD.

    After a certain time period, new users in different time zones come online.

    I need to kick-off users in another time zone off my license server. It is preferable that I can do this my logging people off, and logging people via Azure AD, according to a specific set of rules.

    0 comments No comments

  5. Carlos Lauff 0 Reputation points
    2025-06-20T16:43:29.75+00:00

    The best way to achieve this is using EntraID Connect Sync with PTA. You can manage the logon hours at user properties.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.