Permission & Access Issues

How to Restrict SharePoint Site Access to Specific Hours

Aamir Naveed AkramAamir Naveed Akram Nov 2, 2026 870 views

Question details

Users want to know if they can automatically limit access to a SharePoint site during a specific daily time window, such as from 6:00 a.m. to 6:00 p.m.

How to Restrict SharePoint Site Access to Specific Hours
Product
SharePoint
Device & OS
not provided
Scenario
Administrators need to enforce strict working hours by controlling when users can view or edit content on a SharePoint site.
Observed behavior
SharePoint does not include a built-in, out-of-the-box feature to automatically block or allow site access on a specific hourly schedule.
Before you start

Ensure you have SharePoint Administrator or Microsoft 365 Global Administrator permissions before attempting to modify site permissions or run automation scripts.

Solution 1Recommended

Automate Access Restrictions Using PowerShell

Since there is no native UI feature for hourly restrictions, administrators can use PowerShell combined with scheduled tasks to automate the removal and restoration of site permissions.

PowerShell allows you to interact with your Microsoft 365 environment programmatically. By writing scripts to alter group permissions, you can simulate a time-based access window.

You will need to configure a scheduling tool, such as Windows Task Scheduler or Azure Automation, to trigger these scripts at the required times.

1
Create a Revocation Script

Write a PnP PowerShell script that connects to your SharePoint site and removes the target user group's permissions at the end of the working day.

2
Create a Restoration Script

Write a second PnP PowerShell script designed to grant the necessary permissions back to the user group at the start of the daily access window.

3
Schedule the Automation

Deploy both scripts in Azure Automation as Runbooks, and set up a schedule to execute the restoration script at 6:00 a.m. and the revocation script at 6:00 p.m.

Important Governance Consideration: Always test automated permission scripts in a separate development environment first. Improperly targeted scripts can accidentally remove administrative access and lock you out of the site.
Free Microsoft Office alternative

Enjoy Hassle-Free Document Collaboration with WPS Office

If navigating complex SharePoint permissions is slowing your team down, WPS Office provides a lightweight, user-friendly, and highly compatible alternative for everyday document management and cloud sharing.

  1. 1. Download the Installer: Visit the official WPS Office website to download the free installation package for your operating system.
  2. 2. Install the Software: Run the installer and follow the on-screen instructions to set up the suite on your device.
  3. 3. Start Collaborating: Open your existing Microsoft Office documents in WPS Workspace to effortlessly share and edit files with your team.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Seamless cloud document sharing without the need for complex administrative permission configurations.Lightweight installation with an intuitive, familiar user interface.Completely free to use for standard office productivity tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Does SharePoint have a standard feature for hourly access limits?

No, SharePoint does not currently offer a native, out-of-the-box feature to restrict site access automatically during specific hours of the day.

Can I use Conditional Access to restrict SharePoint logins by time?

Azure Active Directory Conditional Access policies do not natively support time-of-day constraints. Restricting access by time usually requires PowerShell scripts or specialized third-party security management tools.

Can I restrict SharePoint access based on a user's location?

Yes, unlike time-based restrictions, administrators can use Microsoft 365 Conditional Access to enforce location-based policies, restricting site access to designated IP addresses or corporate networks.