Site Lock State Does Not Change After Admin Update: Root Cause and Fix
🔍 WiseChecker

Site Lock State Does Not Change After Admin Update: Root Cause and Fix

You are a SharePoint administrator who has changed a site lock state from Read Only to Unlock, but the site remains read-only for all users. This problem occurs because SharePoint caches lock states and applies them asynchronously across the farm. This article explains the root cause in the content database and the exact steps to force the lock state change to take effect immediately.

Key Takeaways: Forcing a Lock State Update in SharePoint

  • SharePoint Management Shell > Set-SPSite -LockState: Use this PowerShell cmdlet with the -LockState parameter to change the site lock state at the database level.
  • SharePoint admin center > Active sites > site URL > Settings: The UI sets a pending lock state that must be processed by the timer job.
  • Timer job “Site Lock State Update”: This job applies the pending lock state; run it manually after a UI update to force the change.

ADVERTISEMENT

Why the Lock State Does Not Change After an Admin Update

SharePoint stores site lock states in two places: the content database and the site collection object cache. When you change the lock state through the SharePoint admin center UI, the system writes the new value to the content database but marks it as pending. A timer job named “Site Lock State Update” must run to apply the change to the site collection object cache and update the front-end web servers.

The root cause of a stuck lock state is a delay in the timer job schedule. By default, the “Site Lock State Update” timer job runs every 60 minutes. If you need the change to take effect immediately, you must either wait for the job or trigger it manually.

Another cause is that the UI update fails silently when the site is in a locked state that prevents writes to the content database. For example, if you set the lock state to “Read Only” and then try to unlock the site through the UI, the UI may not be able to write the unlock command because the site itself is read-only. In this case, you must use PowerShell to bypass the UI layer.

How the Lock State Cache Works

Each web front-end server caches the lock state for performance. The cache refreshes every 60 seconds by default. Even after the timer job updates the database, the cached value on each server may still show the old state. This is why some users see the site as locked while others see it as unlocked after the change.

Steps to Change the Site Lock State and Force the Update

Use the method that matches your environment. Method 1 works for most cases. Use Method 2 when the UI is unresponsive or when the site is locked as Read Only and you cannot change it through the UI.

Method 1: Change Lock State Through the UI and Run the Timer Job Manually

  1. Open the SharePoint admin center
    Go to https://admin.microsoft.com/SharePoint. Sign in with a SharePoint admin account.
  2. Navigate to Active sites
    In the left navigation, click Active sites. Find the site whose lock state is stuck. Click the site URL to open the details panel.
  3. Change the lock state
    In the details panel, click Settings. Under Site lock state, select the new state: Unlock to remove the lock, Read only to prevent edits, or No access to block all users. Click Save.
  4. Run the timer job manually
    On the SharePoint server, open SharePoint Central Administration. Go to Monitoring > Review job definitions. In the list, find the job named Site Lock State Update. Click the job name. On the job definition page, click Run Now.
  5. Verify the lock state
    Wait 60 seconds for the cache to refresh. Browse to the site URL. Confirm that the site now shows the correct lock state.

Method 2: Change Lock State Using PowerShell

  1. Open SharePoint Management Shell
    On a SharePoint server, right-click SharePoint Management Shell and select Run as administrator.
  2. Get the current lock state
    Run this command to see the current state:
    Get-SPSite -Identity "https://yourtenant.sharepoint.com/sites/yoursite" | Select-Object Url, LockState
    Replace the URL with your site collection URL.
  3. Set the new lock state
    Run this command to change the lock state to Unlock:
    Set-SPSite -Identity "https://yourtenant.sharepoint.com/sites/yoursite" -LockState "Unlock"
    Use "ReadOnly" or "NoAccess" for other states.
  4. Force the change to apply
    Run this command to clear the cache on all front-end servers:
    Get-SPServer | ForEach-Object { $_.CacheReset() }
    This action requires Farm Administrator privileges.
  5. Verify the change
    Run the Get-SPSite command again. The LockState value should match what you set.

ADVERTISEMENT

If the Lock State Still Does Not Change

SharePoint returns “Site is locked” error after unlocking

If you still see the error after running the timer job, the content database may have a corrupt lock state record. Run this PowerShell command to check the database directly:
Get-SPSite -Identity "https://yourtenant.sharepoint.com/sites/yoursite" -Confirm:$false
If the command returns a LockState of “Unlock” but the site still shows as locked, the issue is in the content database row. Contact Microsoft Support to repair the row.

Timer job “Site Lock State Update” does not appear in Central Administration

This timer job is created automatically when you create a site collection. If it is missing, run the following PowerShell command to create it:
New-SPTimerJob -Name "Site Lock State Update" -Type "Microsoft.SharePoint.Administration.SPLockStateTimerJob" -Schedule "Daily from 0:00 to 23:59 every 60 minutes"
Then run the job manually as described in Method 1.

Users in different regions see different lock states

This is a cache propagation delay. After you force the update, wait up to 15 minutes for all front-end servers to refresh their cache. If the issue persists, clear the cache on each server using the PowerShell command in Method 1 step 4.

Item SharePoint Admin Center UI PowerShell Set-SPSite
Lock state options Unlock, Read only, No access Unlock, ReadOnly, NoAccess
Applies change immediately No, waits for timer job Yes, at the database level
Works when site is Read Only No, UI cannot write to locked site Yes, bypasses the UI layer
Requires timer job to complete Yes No, but cache still needs refresh

Use the UI for scheduled changes. Use PowerShell when the site is locked as Read Only or when you need the change to apply immediately.

You can now change the lock state on any SharePoint site and force the update to take effect without waiting for the default timer job schedule. Next, review the “Site Lock State Update” timer job schedule in Central Administration and adjust it to run more frequently if your organization needs fast lock state changes. A practical tip: always run the Get-SPSite command after a UI change to confirm the database value updated before you run the timer job.

ADVERTISEMENT