PRACTITIONER ARTICLE / Security
Finding Sensitive Data with Microsoft Purview: From Microsoft 365 to On-Premises File Servers
Find sensitive data with Microsoft Purview. Test a custom classifier in SharePoint, review Content Explorer results, and scan on-premises file shares.
By Phil Kinsley
Microsoft Purview Technical Series | Part 2
Purview can identify supported sensitive information types in Microsoft 365 and scan supported on-premises repositories. This pilot tests a custom customer-reference classifier in SharePoint and on a file share before enabling labeling or DLP enforcement.
In Part 1, Getting Started with Microsoft Purview: Classify Your Data Before Copilot, we created a Confidential sensitivity label, published it to a pilot group, and established a test for comparing SharePoint permissions with Microsoft 365 Copilot retrieval.
We deliberately left encryption disabled for the initial test. That allowed us to distinguish what the label actually controlled from what SharePoint permissions controlled. We also established that a document doesn't become inaccessible to Copilot simply because somebody has labeled it Confidential.
In Part 1, we knew which document to protect. We selected it, applied the label and tested access. In a production environment, nobody is going to hand us a complete list of documents that need classification.
The information is already distributed across SharePoint, OneDrive, Exchange and, in many organizations, years of on-premises file shares. Some of it follows recognizable patterns. Other information is commercially sensitive without containing anything that looks like a credit card number or national identifier.
This article continues the same pilot. We'll use Microsoft Purview to identify sensitive information, create and test a custom Sensitive Information Type (SIT), examine what Content Explorer can tell us, and extend discovery to an on-premises file server using the Microsoft Purview Information Protection scanner.
Keep the Confidential label and SharePoint permissions from Part 1 in place, with automatic labeling and DLP enforcement disabled during discovery.
What Purview Can Actually Detect
Purview provides a collection of built-in Sensitive Information Types for identifying recognizable information, including credit card numbers, bank account details, national identifiers and other regulated data.
These classifiers can use regular expressions, supporting keywords, checksum validation and other functions to determine whether content matches a definition.
Consider a sixteen-digit number in a document. A regular expression could identify the number, but that alone doesn't establish whether it represents a valid payment card. Microsoft's built-in Credit Card Number SIT incorporates additional validation to improve detection.
Different SITs use different combinations of evidence, which is why their confidence levels matter.
A high-confidence match generally requires stronger evidence than a low-confidence match. This improves precision, although it can also mean legitimate information is missed when the supporting evidence isn't present.
Before using a SIT in a DLP policy, establish how it behaves with the information your organization actually handles.
Inspect the built-in classifiers
In Microsoft Purview, navigate to:
Information Protection > Classifiers > Sensitive info types
Select Credit Card Number and review its detection patterns.
You can test the classifier directly by selecting Test and uploading a supported, unencrypted sample document.
For example:
Test Card: 4242 4242 4242 4242
This is a synthetic payment-card test number. Review the result and compare it with a document containing an arbitrary numerical sequence.
The testing interface evaluates the uploaded file. It doesn't scan existing SharePoint libraries or update historical classification results.
Inspect SIT definitions with PowerShell
Connect using the same Security & Compliance PowerShell environment established in Part 1.
Import-Module ExchangeOnlineManagement
Connect-IPPSSession `
-UserPrincipalName "<your-admin-UPN>"List the available classifiers:
Get-DlpSensitiveInformationType |
Select-Object Name, Id |
Sort-Object NameRetrieve an individual definition:
Get-DlpSensitiveInformationType `
-Identity "Credit Card Number" |
Format-List *This is useful when reviewing existing DLP configurations or confirming the identity of a custom classifier.
A SIT is a reusable detection definition. It can be referenced by supported policies, but creating one doesn't automatically change how documents are labeled or accessed.
Extend the Part 1 Lab with a Custom SIT
In Part 1, we used a synthetic ControlCode in a SharePoint document to test whether Copilot could retrieve information under different permission conditions.
We're going to retain that document and create a second one containing a fictional customer identifier.
For this exercise, customer references use the following format:
NXL-2026-000123
The reference consists of the prefix NXL, a four-digit year and a six-digit number.
A regular expression can identify that structure:
\b(NXL-[0-9]{4}-[0-9]{6})\bMicrosoft Purview uses the Boost.RegEx engine for custom SIT definitions. An important requirement is that the expression contains exactly one capturing group.
This expression satisfies that requirement.
Create the custom classifier
Navigate to:
Information Protection > Classifiers > Sensitive info types > Create sensitive info type
Name the classifier:
Nexlinks Customer Reference
Create a high-confidence pattern with the following settings:
| Setting | Configuration |
|---|---|
| Primary element | Regular expression |
| Expression | \b(NXL-[0-9]{4}-[0-9]{6})\b |
| Supporting element | Keyword list |
| Keywords | Customer Reference`, `Case Reference |
| Character proximity | 100 |
| Confidence | High |
The supporting keywords are intentional.
The expression identifies the format, while the keywords provide context. Requiring both makes it less likely that an unrelated identifier with the same structure will be treated as a customer reference.
There is a trade-off. A valid reference appearing without those keywords won't satisfy the high-confidence pattern.
Test the classifier
Prepare three sample files.
| File | Contents | Expected result |
|---|---|---|
| Positive.txt | Customer Reference: NXL-2026-000123 | High-confidence match |
| Invalid.txt | Customer Reference: NXL-2026-ABC123 | No match |
| NoContext.txt | Record ID: NXL-2026-000123 | No high-confidence match |
Upload each file using the SIT's Test function and review the results.
The third case matters. The identifier satisfies the regular expression but lacks the required supporting keyword.
If that produces a high-confidence match, review the supporting-element configuration rather than assuming the regular expression is wrong.
You could create a second, lower-confidence pattern that matches the identifier without additional evidence. That would expand detection, but it would also require additional validation of false positives.
Don't move straight from a successful positive test to enforcement. Include valid identifiers, malformed identifiers and documents with similar but unrelated content in the test set.
Verify the classifier in PowerShell
After saving the custom SIT, confirm that Purview recognizes it.
Get-DlpSensitiveInformationType `
-Identity "Nexlinks Customer Reference" |
Format-List Name, Id, PublisherThis confirms that the definition exists. It doesn't demonstrate that every workload has processed the new classifier or that historical content has been rescanned.
Supporting reference: Microsoft: Create a custom Sensitive Information Type ↗
Return to the SharePoint Pilot
Now use the SharePoint test site from Part 1.
Keep the original Purview-Pilot-Canary-2026.docx unchanged so the earlier access and Copilot tests remain reproducible.
Create a second Word document:
Purview-Pilot-Discovery-2026.docx
Add the following synthetic text:
Customer Reference: NXL-2026-000123
This document contains fictional information
for Microsoft Purview classification testing.Save the document in the same test site.
Leave it unlabeled initially.
The point is to see whether Purview can identify sensitive information without a user first applying the Confidential label.
The original document was classified manually because we selected it. The new document has recognizable content, but no sensitivity label has been applied.
Keep the same SharePoint permission configuration and test accounts. We're changing the content, not the access model.
What should happen?
Purview's classification processing can identify supported sensitive information types in SharePoint documents, subject to indexing, processing and workload support.
The new custom SIT may therefore identify the customer reference even though the file remains unlabeled.
- A SIT match indicates that the classifier detected content matching its definition.
- A sensitivity label indicates that a classification was assigned to the document.
- Neither result establishes that SharePoint permissions have changed.
This is also why the Confidential label from Part 1 shouldn't be modified to introduce automatic labeling conditions during the discovery test.
We want to observe classification before enabling an action based on it.
Investigate the Results with Content Explorer
Content Explorer provides a way to examine classified information in supported Microsoft 365 workloads.
For the classic experience, navigate to:
Solutions > Data Lifecycle Management > Explorers > Content explorer
Depending on the features available in your tenant, you may also have access to the newer Data Explorer experience.
Content Explorer organizes results by sensitive information type, sensitivity label and retention label.
Search for Nexlinks Customer Reference, then inspect the available locations.
Where classification results have been processed, the SharePoint test document should be identifiable under the relevant SIT.
Don't assume it will appear immediately.
Microsoft states that Content Explorer counts can take up to seven days to update, and SharePoint file results can take up to fourteen days.
A newly created custom SIT also doesn't automatically force every existing document to be reclassified.
What if the document doesn't appear?
First, confirm that the classifier works using its uploaded-file test.
Then check whether the document is in a supported location, whether classification processing has completed, and whether the account has permission to view the results.
For older content, Microsoft provides on-demand classification for supported SharePoint, OneDrive and endpoint data.
This is useful when introducing a new classifier into an environment containing documents that haven't changed for years.
On-demand classification is a separate operation with licensing and pay-as-you-go billing considerations. It can also update classification results that are subsequently used by active DLP and labeling policies.
Review those policies and the estimated cost before initiating a large historical scan.
Content Explorer licensing and permissions
Microsoft 365 E3 supports underlying data classification aggregation, but Content Explorer and Activity Explorer analytics require qualifying E5-level licensing.
In the classic Content Explorer experience, two role groups control access to classified items:
Content Explorer List Viewer permits access to item listings and locations.
Content Explorer Content Viewer permits additional access to item contents and certain sensitive item names.
These permissions are independent. Content Viewer should not be assigned merely because somebody administers Purview.
Microsoft documents that Content Explorer permissions can supersede the local permissions applied to the underlying documents. That makes the Content Viewer role particularly sensitive.
What Content Explorer doesn't tell us
A document containing our customer reference may be detected because it follows a recognizable pattern.
A document outlining an acquisition strategy, proposed restructuring or confidential commercial agreement may contain nothing that matches a built-in or custom SIT.
That document can still be highly sensitive.
Purview also supports other classification methods, including Exact Data Match, document fingerprinting and trainable classifiers. These address different detection requirements, but they don't remove the need to understand what the business considers sensitive.
A low number of reported matches isn't proof that the environment contains little sensitive information. It may simply indicate that the detection methods haven't been configured to recognize it.
Supporting reference: Microsoft: Content Explorer ↗
Extend the Same Discovery Exercise On-Premises
The SharePoint exercise gives us a way to identify sensitive content in Microsoft 365.
That still leaves the information on traditional file servers.
Many organizations have departmental shares containing years of contracts, financial data, customer records and archived project documentation. Some of these repositories haven't been reviewed since long before Microsoft 365 was introduced.
Microsoft provides the Microsoft Purview Information Protection scanner, previously known as the Azure Information Protection unified labeling scanner, to discover and protect supported content in on-premises repositories.
The scanner supports file shares accessed through SMB, NFS in preview, and supported on-premises SharePoint Server repositories.
It runs as a Windows service, uses Windows IFilters to inspect supported files, and can evaluate sensitive information types and configured labeling conditions.
Unlike a real-time file monitoring product, the scanner works through configured repositories in scan cycles. It can run manually or repeatedly, but it doesn't continuously intercept every file operation.
We're going to use the same synthetic customer reference from the SharePoint exercise so that the detection logic can be compared across the two environments.
Licensing
Microsoft makes an explicit distinction between scanner discovery and automatic labeling.
| Capability | Requirement |
|---|---|
| Scanner-based on-premises discovery | Microsoft 365 E3 |
| Scanner-based automatic or policy-driven sensitivity labeling | Microsoft 365 E5 or qualifying Information Protection and Governance licensing |
| On-premises DLP enforcement | Qualifying advanced DLP entitlement |
The header-only Confidential label that we created in Part 1 is supported for manual application in Office with E3. That doesn't mean E3 also licenses automatic labeling through the scanner.
For this exercise, keep the scanner in discovery mode.
Prepare the Scanner
Use a dedicated Windows Server with access to a SQL Server instance and a small test file share.
Microsoft documents four CPU cores, 8 GB of RAM and approximately 10 GB of temporary storage as a starting point for the scanner host.
The server also needs the current general availability Microsoft Purview Information Protection client, which installs the scanner and associated PowerShell module.
Use a dedicated Active Directory service account, for example:
CONTOSO\svc-purview-scan
For this configuration, synchronize the account to Microsoft Entra ID and provide the required authentication and repository access.
For discovery, the account needs permission to read the repository. Labeling and protection will require additional file permissions.
The installation account also needs local administrative privileges on the scanner host and the SQL permissions required to create the scanner configuration database.
Create the cluster and scan job
In Microsoft Purview, navigate to:
Settings > Information Protection > Information protection scanner
Under Clusters, select Add.
Create a cluster named:
Purview-OnPrem-Pilot
Next, create a content scan job using these settings:
| Setting | Configuration |
|---|---|
| Schedule | Manual |
| Info types to be discovered | All |
| Enforce sensitivity labeling policy | Off |
| Label files based on content | On |
| Relabel files | Off |
| Enable DLP rules | Off |
| Preserve file details | On |
The All setting is deliberate. Microsoft's initial deployment procedure uses Policy only, but that limits discovery reporting to configured labeling conditions.
For this broader discovery exercise, All allows the scanner to evaluate supported built-in information types and custom detection conditions. It can be slower, particularly across large repositories, so limit the scope during testing.
Enforcement remains disabled. The scan should report what it discovers without applying sensitivity labels.
Add the repository
Create a share on a test file server:
\\FS01\PurviewLab
Add this path under the scan job's Repositories tab.
Confirm that the scanner service account has the necessary share and NTFS permissions.
Avoid adding a production departmental share until you've validated the scanner against the controlled repository.
Install and Authenticate the Scanner
Install the Microsoft Purview Information Protection client on the scanner server.
Open Windows PowerShell as Administrator and run:
Install-Scanner `
-SqlServerInstance "SQL01\SQLEXPRESS" `
-Cluster "Purview-OnPrem-Pilot"Replace the SQL Server instance with the instance used for your deployment.
When prompted, enter the service account in the format:
CONTOSO\svc-purview-scan
Use the on-premises Windows identity, not the Microsoft Entra UPN.
After installation, verify that the Microsoft Purview Information Protection Scanner service exists.
Configure authentication
The scanner needs a Microsoft Entra token to retrieve its information protection configuration and operate unattended.
Create an application registration in Microsoft Entra ID using the authentication procedure documented for the scanner. Microsoft's client-secret example uses a Web redirect URI of http://localhost.
Configure these application permissions:
| API | Permission |
|---|---|
| Azure Rights Management Service | Content.DelegatedReader |
| Azure Rights Management Service | Content.DelegatedWriter |
| Microsoft Information Protection Sync Service | UnifiedPolicy.Tenant.Read |
Grant administrator consent.
Record the application ID and tenant ID, and store the client secret securely.
The scanner uses the Set-Authentication cmdlet:
$creds = Get-Credential "CONTOSO\svc-purview-scan"
Set-Authentication `
-AppId "<application-id>" `
-AppSecret "<client-secret>" `
-TenantId "<tenant-id>" `
-DelegatedUser "[email protected]" `
-OnBehalfOf $credsRun this using the appropriate scanner identity and supported PowerShell environment. Microsoft also documents an alternative procedure for environments that don't permit interactive logon for service accounts.
For production, retrieve the client secret from an approved secret store and establish a rotation process. An expired application credential can stop unattended scanning.
Supporting reference: Microsoft: Configure and install the Information Protection scanner ↗
Test On-Premises Discovery
Create three text files in the test share using PowerShell.
$Path = "\\FS01\PurviewLab"
@"
Customer Reference: NXL-2026-000123
Classification Test: Positive
"@ | Set-Content "$Path\Positive.txt" -Encoding UTF8
@"
Customer Reference: NXL-2026-ABC123
Classification Test: Invalid
"@ | Set-Content "$Path\Invalid.txt" -Encoding UTF8
@"
Record ID: NXL-2026-000123
Classification Test: Missing Context
"@ | Set-Content "$Path\NoContext.txt" -Encoding UTF8These contain the same three detection cases used to test our custom SIT.
Start the scanner from the Purview portal or run:
Start-ScanMonitor progress with:
Get-ScanStatusOnce the cycle completes, inspect the scanner reports.
The default report directory is:
%localappdata%\Microsoft\MSIP\Scanner\ReportsThis path resolves within the account context used by the scanner. Check the service account's profile if the reports aren't visible under your administrator account.
The scanner produces summary and detailed reports covering processed files, classification findings and errors.
Compare these results with the uploaded-file SIT tests.
If the custom classifier works in the Purview portal but not through the scanner, check the scanner's supported detection capabilities, authentication, current policy, file processing status and repository scope.
The portal SIT test and scanner use different processing paths, so successful detection in one doesn't guarantee identical results in the other.
What if we change the classifier?
The first scan processes the configured files. Subsequent scans generally process new or modified files.
If you update a custom SIT or change labeling conditions, request a full rescan rather than assuming unchanged files will be evaluated again.
Start-Scan -ResetMicrosoft documents the -Reset parameter for forcing a full scan.
This is particularly relevant for legacy file servers. Files that haven't changed for several years won't necessarily be reprocessed simply because you've introduced a new classifier.
Supporting reference: Microsoft: Run and manage scanner operations ↗
Discovery Is Not Automatic Labeling
At this stage, we have used one detection definition in two different environments: a SharePoint document and files stored on-premises.
The scanner can report what it detects without changing the files.
To apply a sensitivity label automatically, you need an appropriate labeling configuration, qualifying licensing and scanner enforcement enabled.
This also requires care with the label from Part 1.
Our existing Confidential label was configured to add a visual marking without encryption. It was not configured for content-based automatic labeling.
Don't assume that the scanner will apply it simply because it detects the custom customer reference.
Configure and test the appropriate content-based labeling conditions first, using a separate pilot policy or label where necessary.
Then enable:
Enforce sensitivity labeling policy: On
Run a full rescan and confirm the resulting labels on supported files.
For an initial labeling test, use a Word document containing the synthetic customer reference.
This is important because file formats behave differently. The scanner can inspect .txt files, but Microsoft documents that a plain-text file cannot receive a sensitivity label that has no encryption. A supported Office document is a better test for the header-only label used in Part 1.
If you introduce an encrypted label, test the resulting access rights separately. The scanner can change the protection associated with a file, which may affect users, applications and automated processes that previously accessed it.
I would keep automatic labeling disabled until the discovery results have been reviewed.
What About On-Premises DLP?
The scanner also supports Purview DLP policies for on-premises repositories.
Depending on the configured policy, DLP can restrict access, remove broad access groups or move matching files into quarantine.
These aren't passive classification actions. They can change filesystem permissions and interrupt legitimate access.
The scanner can also produce permission-related reports that help identify exposure.
For example, discovering sensitive financial information in a folder accessible to Domain Users is a useful finding. Automatically removing that access without understanding which applications or business processes depend on it is a separate decision.
The scanner doesn't provide interactive policy tips to users working with files on-premises, and enforcement follows scan cycles rather than monitoring every operation in real time.
We'll leave on-premises DLP disabled for this exercise and address policy simulation and enforcement in Part 3.
Record the Results Before Expanding the Pilot
Part 1 established a test record for determining whether Copilot could retrieve a known document under specific permissions.
Use the same approach here.
The expected outcomes are based on our custom SIT configuration. The observed results need to be recorded from the tenant and scanner after execution.
| Test | Expected result |
|---|---|
| Custom SIT: valid reference and keyword | High-confidence match |
| Custom SIT: invalid identifier | No match |
| Custom SIT: valid reference without keyword | No high-confidence match |
| SharePoint pilot document | Classification becomes discoverable after processing |
| On-premises discovery scan | Matching files reported without labeling enforcement |
| Full scanner rescan | Existing files reevaluated |
For the on-premises test, retain the scanner version, job configuration, execution timestamp and detailed reports.
For SharePoint, record the document location, SIT definition, classification status and any processing delay.
If a test fails, distinguish between failure to detect content, failure to process the file, and failure to display the result in the reporting interface.
A classifier reporting no matches because the file was skipped isn't evidence that the document contains no sensitive information.
What These Results Mean for Copilot
We started this series by examining whether Copilot could access a document that had already been labeled Confidential.
This exercise addresses the earlier stage: identifying information that might need that classification in the first place.
A custom SIT can help locate structured customer identifiers across supported Microsoft 365 content. The on-premises scanner extends similar discovery to file shares and supported SharePoint Server repositories.
Neither operation automatically corrects permissions.
A document can be accurately detected as containing sensitive information and still remain accessible through overly broad SharePoint permissions. Similarly, scanning an on-premises file server doesn't make its contents available to Microsoft 365 Copilot through Microsoft Graph.
Discovery, labeling, access control and AI grounding are separate concerns.
There's also a limit to how much we can learn from pattern-based detection. Some business-sensitive information won't contain recognizable identifiers, and some content can't be processed because of its format, encryption or location.
Purview can help identify information that deserves attention, but its reports need to be interpreted alongside the actual repository permissions and business context.
Continue the pilot
In Part 1, we established how a sensitivity label behaves and how it interacts with SharePoint permissions and Copilot retrieval.
We've now extended that work to identify information before it is labeled.
The custom SIT provides a reusable method for recognizing structured information. Content Explorer can help investigate classification results in supported Microsoft 365 locations, while the Information Protection scanner extends discovery to traditional on-premises repositories.
That gives us a better basis for deciding which documents need labeling and where additional protection may be appropriate.
It also gives us something specific to test rather than configuring a policy against a repository we haven't examined.
In the planned Part 3, we'll use these same classifiers and test documents to build a Microsoft Purview DLP policy for Exchange Online, SharePoint and OneDrive. We'll start in simulation mode, review the matches and false positives, and examine the effect of enforcing restrictions on legitimate sharing.
Record the results from this pilot before moving to DLP simulation.
Primary source
Microsoft Purview Information Protection scanner overview ↗Further sources
Learn about Sensitive Information Types ↗
Create custom Sensitive Information Types ↗
Test a Sensitive Information Type ↗
Information Protection scanner overview ↗
Scanner installation and configuration ↗
Continue reading
Building Your First Microsoft Purview DLP Policy: From Detection to Enforcement ↗
Getting Started with Microsoft Purview: Classify Your Data Before Copilot ↗
Purview E3 and E5 licensing: start with the control you need ↗