Data Protection Issues

How SharePoint Online Scans Uploaded Files for Viruses

Adam DavisAdam Davis Nov 14, 2026 870 views

Question details

Understand how SharePoint Online scans uploaded files for malware and whether its scanning service can scan files in Azure Storage.

How SharePoint Online Scans Uploaded Files for Viruses
Product
SharePoint Online and Azure Storage
Device & OS
not provided
Scenario
An administrator wants to protect files uploaded to SharePoint Online and files stored in Azure Storage.
Observed behavior
SharePoint Online scans uploaded files asynchronously. Azure Storage requires a separate supported malware-scanning solution.
Before you start

Identify whether the files are stored in SharePoint Online or Azure Storage, since each service requires its own protection settings. To change SharePoint tenant settings, you need an account with the appropriate SharePoint administrator permissions.

Solution 1Recommended

Block downloads of infected SharePoint Online files

Use this setting to prevent users from downloading files that SharePoint Online has identified as infected.

SharePoint Online uses Microsoft 365 malware detection to scan uploaded files asynchronously. A detected file is flagged, but the scan does not necessarily finish at the moment of upload.

1
Install the management shell

Install or open the SharePoint Online Management Shell on a supported computer.

2
Connect to the tenant

Run Connect-SPOService -Url https://<tenant>-admin.sharepoint.com, replacing <tenant> with your tenant name, and sign in with an authorized administrator account.

3
Block infected downloads

Run Set-SPOTenant -DisallowInfectedFileDownload $true to prevent downloads of files detected as infected, including downloads through the antivirus warning.

Block downloads of infected SharePoint Online files
Scanning is asynchronous: This setting applies to files detected as infected; it does not guarantee that every file has been scanned before a user accesses it.
Free Microsoft Office alternative

Work with Office files in WPS Office

WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations in a familiar interface. Its Office-format support makes it easier to move existing files between applications. WPS Office does not replace SharePoint or Azure Storage malware scanning.

Open and edit files downloaded from SharePoint after the appropriate security checksCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface for a smoother move from Microsoft OfficeFree, lightweight tools for common office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Does SharePoint Online scan files immediately when they are uploaded?

SharePoint Online scans uploaded files asynchronously, so scanning may not be complete at the moment an upload finishes.

How do I prevent downloads of files detected as infected?

Connect to your tenant using Connect-SPOService in the SharePoint Online Management Shell, then run Set-SPOTenant -DisallowInfectedFileDownload $true.

Can I use SharePoint's virus-scanning service as an API for Azure Storage?

No. SharePoint Online's malware detection is not a general-purpose Azure Storage scanning API. Use Microsoft Defender for Storage or another supported security service instead.

Will enabling Defender for Storage automatically scan all existing files?

Do not assume it will. Check the current Defender for Storage documentation and settings for supported scanning options, including coverage for existing files.