Skip to content

Background Job: Auto‑Assign Site Collection Administrator

July 2025

Overview

This optional background‑job SiteCollectionAdminPromotionJob automatically assigns the ShArc service account as Site Collection Administrator to all SharePoint sites in the tenant. It helps ensure consistent access to files to be offloaded as well as .sharc files to be restored regardless of their location.

 

Default State

The job is disabled by default.

 

Behavior When Enabled

  • Assigns the ShArc service account as Site Collection Administrator to every site collection in the SharePoint tenant, including those not explicitly granted.
  • Although the service account could manually assign itself due to SharePoint Administrator role, this job automates it uniformly.
  • Provides full tenant-wide access to all document libraries and files. → Any file can be offloaded and any .sharc file can be restored regardless of site location.

 

Behavior When Disabled

  • The service account has access only to sites where it is explicitly assigned as Site Collection Administrator.
  • Sites without explicit assignment:

    • Files in this sites cannot be previewed or offloaded.
    • .sharc files located there (i.e. due to copy or move) cannot be restored. Attempts will result in error, as ShArc cannot detect or access them.

 

Recommended Usage

  • We strongly recommend enabling the background job to ensure complete coverage.
  • Set a recurrence interval, with the following recommendations:

    • Every 72 hours (3 days) — suitable in most environments.
    • Shorten interval if new site creation is frequent.
    • Do not run more than twice per day (no lower than 12-hour interval) to avoid heavy load on SharePoint.

 

Configuration Instructions

Important Hint: Only change this setting when no offload or restore job is currently running, as any active job will be canceled when the web app is stopped and restarted.

  • Configure using the environment variableSHARC_SiteCollectionAdminPromotionJob__DetectionInterval in your Web App settings with format hh:mm:ss:

    • 0 = disabled

    • 72:00:00 = run every 72 hours

    • Hint: When changing the environment variable via the Azure settings UI, you must confirm three times:

      • Click Apply in the editing dialog for the setting.
      • Click Apply again on the overall Environment variables screen.
      • Click Confirm to save all pending changes.
  • After adjusting this value:

    • Stop the web app server.
    • Wait a few seconds.
    • Start the web app server again—to ensure the new configuration is applied.
ShArc_Web_App_Environment_Variable_Setting



Summary Comparison

Feature Enabled Disabled
Admin rights across sites Assigned on all site collections Only on explicitly granted sites
Document library access Full, tenant-wide Limited to granted sites
.sharc file restore capability Always possible Fails on inaccessible sites
Recommended for tenants with frequent site creation

RELATED ARTICLES