PurviewTroubleshooting

Microsoft Purview Information Protection scanner: install, scan jobs and fixing errors

Install the Microsoft Purview Information Protection scanner, run discovery and enforcement scan jobs, and fix its token, policy, database and connection errors.

The Microsoft Purview Information Protection scanner (formerly the Azure Information Protection unified labeling scanner) discovers, labels and protects files on on-premises file shares and SharePoint Server. It has more moving parts than most Purview features: a Windows service, a SQL Server database, an Active Directory service account, a Microsoft Entra app and a cluster defined in the portal. In this post I'll walk through a clean install and match each error Microsoft documents to the part that's broken.

Errors this guide fixes

  • Microsoft.InformationProtection.Exceptions.AccessDeniedException: The service didn't accept the auth token.Scanner log / Start-ScannerDiagnostics
  • NoAuthTokenException: Client application failed to provide authentication token for HTTP requestScanner log / Start-ScannerDiagnostics
  • Policy is missingScanner log / Start-ScannerDiagnostics
  • Policy does not include any automatic labeling conditionScanner Nodes page (admin portal)
  • DB schema is not up to date. Run Update-ScannerDatabase command to update the DB schemaScanner Nodes page (admin portal)
  • System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.Scanner log (MSIPScanner.iplog)
  • Only one usage of each socket address (protocol/network address/port) is normally permittedScanner log (MSIPScanner.iplog)
  • No cluster foundScanner Nodes page (admin portal)
How this guide is organized: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (6 steps: Check the prerequisites; Create the cluster and a content scan job; Install the service with the matching cluster name; Register the Entra app and get a token; Clear policy, database and network errors; Move from discovery to enforcement). 4. Verify the fix. 5. Prevent it next time. Toolbox: Update-ScannerDatabase, Start-ScannerDiagnostics, Set-Authentication, db_owner, *.aadrm.com.1Symptoms2Why it happens3How to fix it4Verify the fix5Prevent it nexttime1Check theprerequisites2Create thecluster and a…3Install theservice with t…4Register theEntra app and…5Clear policy,database and…6Move fromdiscovery to…TOOLBOXUpdate-ScannerDatabaseStart-ScannerDiagnosticsSet-Authenticationdb_owner*.aadrm.comHow this guide is organized: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (6 steps: Check the prerequisites; Create the cluster and a content scan job; Install the service with the matching cluster name; Register the Entra app and get a token; Clear policy, database and network errors; Move from discovery to enforcement). 4. Verify the fix. 5. Prevent it next time. Toolbox: Update-ScannerDatabase, Start-ScannerDiagnostics, Set-Authentication, db_owner, *.aadrm.com.1Symptoms2Why it happens3How to fix it1Check the prerequisites2Create the cluster and a content scan job3Install the service with the matching clustername4Register the Entra app and get a token5Clear policy, database and network errors6Move from discovery to enforcement4Verify the fix5Prevent it next timeTOOLBOXUpdate-ScannerDatabaseStart-ScannerDiagnosticsSet-Authenticationdb_owner*.aadrm.com
At a glance: how this guide is organized · 6 fix steps · 5 key tools

Symptoms#

The scanner service is installed but nothing gets scanned or labeled, and one of these messages appears in the scanner log (%localappdata%\Microsoft\MSIP\Logs of the service account), in the output of Start-ScannerDiagnostics, or on the scanner's Nodes page in the admin portal:

Text
Microsoft.InformationProtection.Exceptions.AccessDeniedException: The service didn't accept the auth token.
NoAuthTokenException: Client application failed to provide authentication token for HTTP request
Policy is missing
Policy does not include any automatic labeling condition
DB schema is not up to date. Run Update-ScannerDatabase command to update the DB schema
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
No content scan job found
No repositories are configured
No cluster found

Other signs: the Scan now button is missing for a content scan job (it only appears when a node for that job is online), or a scan sits on one file for a long time and then stops.

Why it happens#

The scanner's moving parts and the error each one causesOn-premises resources: SQL Server database, Repositories. Scanner server: Scanner service. Entra ID and Purview: Entra app and token, Cluster and content scan job, Label policy. Connections: 1. Scanner service → SQL Server database: db_owner for the service account, else DB errors. 2. Scanner service → Repositories: Read to discover; labeling adds Write and Modify, or Full Control. 3. Scanner service → Entra app and token: Without a valid token, AccessDeniedException or NoAuthTokenException. 4. Scanner service → Cluster and content scan job: Install-Scanner -Cluster must match, else No cluster found. 5. Scanner service → Label policy: With no published label, you get Policy is missing.ON-PREMISES RESOURCESSQL Server databaseSchema must match thescanner versionRepositoriesFile shares and SharePointServerSCANNER SERVERScanner serviceAD service account; TLS 1.2enabledENTRA ID AND PURVIEWEntra app and tokenValid as long as the clientsecretCluster and contentscan jobThe job needs at least onerepositoryLabel policyPublished to the-DelegatedUser account12345CONNECTIONS1Scanner service → SQL Server database: db_owner for the service account, else DB errors2Scanner service → Repositories: Read to discover; labeling adds Write and Modify, or Full Control3Scanner service → Entra app and token: Without a valid token, AccessDeniedException or NoAuthTokenException4Scanner service → Cluster and content scan job: Install-Scanner -Cluster must match, else No cluster found5Scanner service → Label policy: With no published label, you get Policy is missingThe scanner's moving parts and the error each one causesOn-premises resources: SQL Server database, Repositories. Scanner server: Scanner service. Entra ID and Purview: Entra app and token, Cluster and content scan job, Label policy. Connections: 1. Scanner service → SQL Server database: db_owner for the service account, else DB errors. 2. Scanner service → Repositories: Read to discover; labeling adds Write and Modify, or Full Control. 3. Scanner service → Entra app and token: Without a valid token, AccessDeniedException or NoAuthTokenException. 4. Scanner service → Cluster and content scan job: Install-Scanner -Cluster must match, else No cluster found. 5. Scanner service → Label policy: With no published label, you get Policy is missing.ON-PREMISES RESOURCESSQL Server databaseSchema must match the scanner versionRepositoriesFile shares and SharePoint ServerSCANNER SERVERScanner serviceAD service account; TLS 1.2 enabledENTRA ID AND PURVIEWEntra app and tokenValid as long as the client secretCluster and content scan jobThe job needs at least one repositoryLabel policyPublished to the -DelegatedUser accountCONNECTIONS1Scanner service → SQL Server database: db_ownerfor the service account, else DB errors2Scanner service → Repositories: Read to discover;labeling adds Write and Modify, or Full Control3Scanner service → Entra app and token: Without avalid token, AccessDeniedException orNoAuthTokenException4Scanner service → Cluster and content scan job:Install-Scanner -Cluster must match, else No clusterfound5Scanner service → Label policy: With no publishedlabel, you get Policy is missing
Figure 1 · Architecture The scanner's moving parts and the error each one causes. Each line is a dependency of the scanner service; its label says what the part needs and which error appears when it's broken.
  • Authentication. The service runs unattended, so it needs a token created with Set-Authentication for the service account. A missing token, an Entra app without the right permissions or admin consent, or an expired client secret all end in the token errors.
  • Policy. The scanner uses the label policy of the account you name in -DelegatedUser, so at least one sensitivity label must be published to it, and the downloaded policy file must be readable. If the labels have no auto-labeling conditions and the job has no default label, the scanner has nothing to apply.
  • Database. The service account needs db_owner on the configuration database, and the schema must match the installed scanner version.
  • Configuration mismatch. The cluster name you pass to Install-Scanner must match a cluster in the portal, and its content scan job needs at least one repository.
  • Network. The "underlying connection was closed" family means TLS 1.2 isn't enabled. The socket error means the scanner exceeded the number of allowed network connections.

How to fix it#

1. Check the prerequisites#

  • 64-bit Windows Server 2016, 2019, 2022 or 2025 (Server Core and Nano Server aren't supported), 4 cores, 8 GB RAM and about 10 GB free disk space for temporary files.
  • The full Microsoft Purview Information Protection client, not just its PowerShell module.
  • SQL Server 2016 or later (Express for test environments only) with case-insensitive collation. The installing account needs the Sysadmin role so setup can create the database (AIPScannerUL_<cluster name>) and grant the service account db_owner; if that's not allowed, a DBA can create it manually.
  • A service account that is an Active Directory account synchronized to Microsoft Entra ID, with Log on locally during installation and configuration. Setup grants Log on as a service itself.
  • Repository permissions: Read is enough for discovery; labeling needs Read, Write and Modify on file shares, or Full Control on SharePoint Server.
  • Outbound HTTPS to the documented URLs, including *.aadrm.com, *.azurerms.com, *.informationprotection.azure.com and *.protection.outlook.com.

2. Create the cluster and a content scan job#

In the Microsoft Purview portal, open Settings › Information Protection › Information protection scanner. On Clusters, add a cluster (for example Europe). On Content scan jobs, add a job with Schedule set to Manual, Info types to be discovered set to Policy only and Enforce sensitivity labeling policy set to Off. Open the saved job and add repositories on its Repositories tab as UNC paths (\\Server\Folder) or SharePoint Server URLs. OneDrive locations, WebDAV paths and wildcards aren't supported.

3. Install the service with the matching cluster name#

PowerShell
# Elevated PowerShell on the scanner server
Install-Scanner -SqlServerInstance SQLSERVER1\SCANNER -Cluster Europe
# When prompted, enter the service account as DOMAIN\username (not a UPN)

Microsoft warns that a UPN at that prompt can cause identity and service-startup problems later. If the Nodes page reports No cluster found, compare the -Cluster value with the portal for typos.

4. Register the Entra app and get a token#

Register an app (for example InformationProtectionScanner) and create a client secret. Under API permissions, add the application permissions Content.DelegatedReader and Content.DelegatedWriter from Azure Rights Management Service and UnifiedPolicy.Tenant.Read from Microsoft Information Protection Sync Service, then select Grant admin consent. Create the token for the service account:

PowerShell
$pscreds = Get-Credential CONTOSO\scanner
Set-Authentication -AppId "<application id>" -AppSecret "<client secret>" -TenantId "<tenant id>" `
    -DelegatedUser scanner@contoso.com -OnBehalfOf $pscreds

Success ends with Acquired application access token on behalf of CONTOSO\scanner. The token is valid as long as the client secret, so rerun the command with a new secret before the old one expires. Certificate-based authentication is in public preview; if it fails with Keyset does not exist, the service account can't read the certificate's private key, or the certificate was created with a CNG provider.

5. Clear policy, database and network errors#

  • Policy is missing: publish at least one sensitivity label to the -DelegatedUser account, then check that %localappdata%\Microsoft\MSIP\mip\MSIP.Scanner.exe\mip\mip.policies.sqlite3 exists for the service account. Start-ScannerDiagnostics -ResetConfig refreshes the policy even if the last refresh was recent.
  • No automatic labeling condition: add auto-labeling conditions to your labels, or set Info types to be discovered to All and define a default label in the job.
  • DB error or schema mismatch: check connectivity and db_owner for the service account, then run Update-ScannerDatabase.
  • Connection closed: enable TLS 1.2 on the scanner server.
  • Socket error or a stuck scan: increase the dynamic port range on the server that hosts the files, and for large SharePoint libraries review the list view threshold (5,000 by default). Run Export-DebugLogs before you restart the service.
  • No content scan job found / No repositories are configured: finish the job in the portal and add at least one repository.
  • Turn on Enable DLP rules only if a DLP policy exists; without one, the scanner generates errors.

6. Move from discovery to enforcement#

Run the first cycle in discovery mode and review the reports in %localappdata%\Microsoft\MSIP\Scanner\Reports. When the results look right, edit the job: set Schedule to Always and Enforce sensitivity labeling policy to On, then select Scan now. If labels reprotect files or remove protection, make the service account a Rights Management super user (see the super user feature). By default the scanner protects only Office files and PDFs; the PFileSupportedExtensions advanced label policy setting changes that.

Verify the fix#

PowerShell
Start-ScannerDiagnostics -OnBehalfOf (Get-Credential CONTOSO\scanner) -Verbose
$s = Get-ScanStatus
$s.NodesInfo
$s.NodesInfo[0].Summary   # ScannedFiles, FailedFiles, Classified, Labeled

Healthy looks like this: the diagnostics checks (database, URLs, token and policy, configuration, rules) report no failures. Each node shows Scanning or completes its cycle, repositories move from Pending to Finished, FailedFiles stays at or near zero, and the detailed report lists the files you expected to be classified or labeled. In the portal, the node is online and Scan now is available.

Prevent it next time#

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)