How to Restrict SharePoint Site Access to Specific Hours
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.

- 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.
Ensure you have SharePoint Administrator or Microsoft 365 Global Administrator permissions before attempting to modify site permissions or run automation scripts.
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.
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.
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.
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.
Manually Modify Site Permissions
If you only need to restrict access temporarily or occasionally, you can manually remove and restore permissions directly through the SharePoint interface.
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. Download the Installer: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Install the Software: Run the installer and follow the on-screen instructions to set up the suite on your device.
- 3. Start Collaborating: Open your existing Microsoft Office documents in WPS Workspace to effortlessly share and edit files with your team.

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.




