Create and publish sensitivity labels in Microsoft Purview Information Protection, configure encryption and content marking, deploy auto-labeling policies for documents and emails, monitor label usage analytics, and establish a data classification governance framework.
Microsoft Purview Information Protection is a cloud-based solution that helps organizations discover, classify, and protect sensitive data wherever it lives or travels across Microsoft 365, on-premises, and third-party SaaS applications. Sensitivity labels are metadata tags applied to documents and emails that define the classification level and trigger protection actions such as encryption, content marking, and access restrictions.
Auto-labeling policies use sensitive information types (SITs), trainable classifiers, and exact data match (EDM) to automatically detect and classify content without relying on end-user action. This lab walks you through a complete, enterprise-grade deployment: from designing your label taxonomy through creating labels, configuring encryption, publishing to users, deploying auto-labeling, and establishing ongoing governance.
Woodgrove Bank, a financial services company with 3,000 employees, must classify and protect customer PII, financial records, and internal strategy documents across Microsoft 365 to comply with GDPR, CCPA, and SOX regulations. The compliance team has identified over 15,000 documents containing unclassified sensitive data across SharePoint Online, OneDrive, and Exchange.
Regulatory auditors require evidence that all sensitive data is labeled, encrypted when appropriate, and access-controlled within 90 days. The organization needs both manual labeling (user-driven) and automatic labeling (policy-driven) to achieve full coverage without disrupting productivity. Success criteria: 100% label coverage for new content, 95%+ auto-labeling accuracy, encryption on Highly Confidential data, and quarterly compliance reporting.
According to the IBM Cost of a Data Breach Report, the average cost of a data breach reached $4.45 million in 2023, with breaches involving unclassified or improperly protected data costing 28% more. GDPR fines have exceeded โฌ4 billion since enforcement began, with many penalties stemming from inadequate data classification and protection controls.
Insider threats account for 25% of data breaches, and sensitivity labels with encryption prevent unauthorized access even when files are exfiltrated or shared improperly. Organizations with mature data classification programs reduce incident response time by 33% because responders can immediately assess the sensitivity of compromised data. Automated labeling eliminates the human inconsistency factor: studies show manual-only labeling programs achieve less than 60% coverage, while auto-labeling pushes coverage above 95%.
Install-Module ExchangeOnlineManagement) for scripted configurationThe first step is to access the Information Protection blade in the Microsoft Purview compliance portal. This is the central management hub where you create labels, define policies, monitor analytics, and configure auto-labeling. You will also verify that unified labeling is active and review any existing labels in your tenant.
Connect to Security & Compliance PowerShell and verify that Information Protection labels are accessible:
# Connect to Security & Compliance PowerShell
# WHY: Establishes a remote session to the Microsoft Purview compliance centre
# using modern authentication (supports MFA). Required before running any
# sensitivity label, DLP, or compliance cmdlets.
Connect-IPPSSession -UserPrincipalName admin@contoso.com
# Verify Information Protection is available
# WHAT: Lists all sensitivity labels defined in the tenant
# OUTPUT: DisplayName (user-facing name), Guid (unique identifier used in policies),
# Priority (lower number = lower sensitivity; higher = more restrictive)
# EXPECT: If no labels appear, unified labeling may not be activated in your tenant
Get-Label | Format-Table DisplayName, Guid, PriorityGet-Label returns no results, your tenant may still be using the legacy Azure Information Protection classic client. Navigate to Settings > Integrated apps in the Microsoft 365 admin center and verify that unified labeling is activated. Migration from classic labels to unified labels is a one-time, irreversible operation.Before creating labels in the portal, you need a well-designed taxonomy that aligns with your organization's data classification policy. A good taxonomy is simple enough for users to understand but granular enough to apply appropriate protections. This step focuses on planning. no technical configuration yet.
Design a four-tier hierarchy with sub-labels for the two highest sensitivity levels:
For each label, decide which Microsoft 365 workloads it applies to. Scope options include:
Now that your taxonomy is designed, create the labels in the Microsoft Purview compliance portal. Each label needs a display name, tooltip, description, scope, and priority order. You will create parent labels first, then add sub-labels underneath them.
ConfidentialConfidentialBusiness data that could cause harm if shared externally. Apply to internal business-sensitive documents.Parent label for business-sensitive content. Sub-labels define specific audience restrictions.Use PowerShell to create labels programmatically, which is especially useful for bulk creation or infrastructure-as-code deployments:
# Create a Confidential label
# WHAT: Creates a top-level parent sensitivity label in the tenant
# WHY: Parent labels organise the taxonomy; protection actions are
# configured on sub-labels, not the parent itself
# -Tooltip: Text shown to users when hovering over the label in Office apps
# -Comment: Admin-only description visible in the compliance portal
New-Label -DisplayName "Confidential" -Name "Confidential" -Tooltip "Business data that could cause harm if shared externally" -Comment "Apply to internal business-sensitive documents"
# Create a sub-label for Confidential \ All Employees
# WHAT: Creates a child label nested under the Confidential parent
# -ParentId: Links this sub-label to its parent using the parent's GUID
# WHY: Sub-labels carry the actual protection settings (encryption,
# content marking) while the parent provides the hierarchy
# OUTPUT: A new label appears under Confidential in the portal and Office apps
New-Label -DisplayName "All Employees" -Name "Confidential-AllEmployees" -ParentId (Get-Label -Identity "Confidential").Guid -Tooltip "Confidential data accessible to all employees"Name cannot be changed (the DisplayName can be updated). Plan your naming convention carefully before creating labels in production.Encryption is the most powerful protection action a label can apply. When a labeled document is encrypted, the protection travels with the file regardless of where it is stored, copied, or forwarded. Only authorized users can open encrypted content, even if it leaves your organization's boundaries.
# Configure encryption on a label
# WHAT: Enables Azure Rights Management encryption on the Confidential\All Employees label
# WHY: Encryption travels with the file - even if exfiltrated, only authorised
# users can open it. This is the strongest protection a label can apply.
# -EncryptionProtectionType "Template": Uses admin-defined permissions (not user-chosen)
# -EncryptionRightsDefinitions: Grants specific rights to the contoso.com domain:
# VIEW = open/read, DOCEDIT/EDIT = modify content, PRINT = print,
# EXTRACT = copy text, OBJMODEL = programmatic access (macros)
# OUTPUT: All future documents labeled Confidential\All Employees will be encrypted
Set-Label -Identity "Confidential-AllEmployees" `
-EncryptionEnabled $true `
-EncryptionProtectionType "Template" `
-EncryptionRightsDefinitions "domain:contoso.com:VIEW,VIEWRIGHTSDATA,DOCEDIT,EDIT,PRINT,EXTRACT,OBJMODEL"Content marking adds visual indicators to labeled documents: headers, footers, and watermarks. These markings serve as a constant reminder of the document's classification and help prevent accidental sharing. Unlike encryption, content marking is visible. it acts as a deterrent and provides context to anyone viewing the document.
CONFIDENTIAL. Contoso Internal10#b35a5a (red)CenterThis document is classified as Confidential8#808080 (gray)CenterCONFIDENTIAL48#b35a5a (red)Diagonal# Add header, footer, and watermark to the label
# WHAT: Configures visual content marking on the Confidential\All Employees label
# WHY: Visual indicators remind users of the document's classification and deter
# accidental sharing. Markings are applied by Office apps at label-apply time.
# HEADER: Red centered text at the top of every page - immediately visible
# FOOTER: Gray centered text at the bottom - provides classification context
# WATERMARK: Diagonal text overlay - only applies to Word documents
# NOTE: Existing documents won't update until the user re-opens and saves them
Set-Label -Identity "Confidential-AllEmployees" `
-ContentMarkingHeaderEnabled $true `
-ContentMarkingHeaderText "CONFIDENTIAL. Contoso Internal" `
-ContentMarkingHeaderFontSize 10 `
-ContentMarkingHeaderFontColor "#b35a5a" `
-ContentMarkingHeaderAlignment "Center" `
-ContentMarkingFooterEnabled $true `
-ContentMarkingFooterText "This document is classified as Confidential" `
-WatermarkEnabled $true `
-WatermarkText "CONFIDENTIAL"DRAFT watermarks for documents under review, then removing watermarks when finalized.Labels are not visible to users until they are published via a label policy. A label policy defines which labels users see, which users and groups the labels apply to, and what default behaviors are enforced (default labels, mandatory labeling, justification for downgrading). You can create multiple policies for different groups of users.
GeneralGeneralGlobal Label Policy# Create a label policy to publish labels to all users
# WHAT: Publishes the selected sensitivity labels so they appear in Office apps
# WHY: Labels are invisible to users until published via a policy - this is the
# step that makes labeling available across the organisation
# -Labels: List of label names to include (parent + sub-labels)
# -ExchangeLocation/SharePointLocation/OneDriveLocation "All": Publish to all M365 workloads
# -Settings:
# DefaultLabelId: Auto-applies "General" to new documents/emails (reduces unlabeled content)
# MandatoryLabelEnabled: Users MUST select a label before saving/sending
# JustificationEnabled: Users must explain why when downgrading a label
# OUTPUT: Labels appear in the Sensitivity button in Office apps within 4-24 hours
New-LabelPolicy -Name "Global Label Policy" `
-Labels "Public","General","Confidential","Confidential-AllEmployees","Highly Confidential" `
-ExchangeLocation "All" `
-SharePointLocation "All" `
-OneDriveLocation "All" `
-Settings @{
"DefaultLabelId" = (Get-Label -Identity "General").Guid;
"MandatoryLabelEnabled" = "true";
"JustificationEnabled" = "true"
}Auto-labeling policies automatically detect and classify content based on sensitive information types (SITs), trainable classifiers, or exact data match (EDM). Unlike manual labeling which depends on user action, auto-labeling ensures consistent classification at scale. Always deploy in simulation mode first to validate accuracy before turning on automatic application.
Auto-Label PII Financial# Create an auto-labeling policy for credit card numbers
# WHAT: Deploys a service-side auto-labeling policy that scans content across
# SharePoint, OneDrive, and Exchange for sensitive information types
# WHY: Ensures consistent classification without relying on user action -
# auto-labeling typically achieves 95%+ coverage vs 60% for manual-only
# -Mode "TestWithNotifications": Runs in SIMULATION mode first - shows what
# would be labeled without actually applying labels. Always start here.
# -ApplySensitivityLabel: The label to apply when a match is found
New-AutoSensitivityLabelPolicy -Name "Auto-Label PII Financial" `
-SharePointLocation "All" `
-ExchangeLocation "All" `
-OneDriveLocation "All" `
-ApplySensitivityLabel (Get-Label -Identity "Confidential-AllEmployees").ImmutableId `
-Mode "TestWithNotifications"
# Add a rule for credit card detection
# WHAT: Defines the sensitive information type (SIT) that triggers the auto-label
# -MinCount 1: Even a single credit card number triggers the policy
# -MinConfidence 85: High confidence threshold reduces false positives
# (85% means the pattern strongly matches a real credit card, not just any 16 digits)
# OUTPUT: After 24-48 hours, check simulation results to review matched items
New-AutoSensitivityLabelRule -Policy "Auto-Label PII Financial" `
-Name "Credit Card Detection" `
-ContentContainsSensitiveInformation @{
Name = "Credit Card Number";
MinCount = 1;
MinConfidence = 85
}Before rolling out to the full organization, thoroughly test label application across all workloads: manual labeling in Office desktop apps, default label application for new documents, auto-labeling on SharePoint and OneDrive files, and email labeling in Outlook. Verify that encryption, content marking, and access restrictions work as expected.
CONFIDENTIAL. Contoso InternalThis document is classified as ConfidentialCONFIDENTIAL# Check label status on a specific document
# WHAT: Reads the sensitivity label metadata from a file on a network share
# OUTPUT: Shows the applied label name, label ID, and whether it was applied
# manually or automatically. Useful for spot-checking test documents.
Get-FileSensitivityLabelInfo -Path "\\server\share\TestDocument.docx"
# View auto-labeling simulation results
# WHAT: Retrieves the current mode and processing status of the auto-label policy
# OUTPUT: Mode (TestWithNotifications = simulation, Enable = enforcing),
# Status (InProgress, Completed, or Failed)
# EXPECT: Wait 24-48 hours after creation before checking simulation results
Get-AutoSensitivityLabelPolicy -Identity "Auto-Label PII Financial" | Format-List Mode, StatusTechnical deployment is only half the battle. user adoption determines the success of your labeling program. Create clear training materials, communicate the “why” behind labeling, and establish support channels for questions. Frame sensitivity labeling as data stewardship, not bureaucratic overhead.
Once labels are deployed, continuous monitoring is essential to measure adoption, detect compliance gaps, and tune auto-labeling accuracy. Microsoft Purview provides several analytics tools: the Data Classification dashboard, Activity Explorer, Content Explorer, and the unified audit log.
# Export label activity for reporting
# WHAT: Searches the unified audit log for all sensitivity label events in the last 30 days
# WHY: Generates data for compliance dashboards and quarterly governance reviews
# -RecordType "MIPLabel": Filters to Microsoft Information Protection label events only
# -ResultSize 5000: Maximum records per call (use paging for larger datasets)
# OUTPUT: CSV file with columns: CreationDate, UserIds (who applied/changed the label),
# Operations (LabelApplied, LabelChanged, LabelRemoved), AuditData (full JSON details)
# USE: Import into Power BI or Excel to visualise label adoption trends over time
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
-RecordType "MIPLabel" -ResultSize 5000 |
Select-Object CreationDate, UserIds, Operations, AuditData |
Export-Csv -Path "LabelActivity.csv" -NoTypeInformation# Find label downgrades in the last 7 days
# WHAT: Detects when users changed a label from higher to lower sensitivity
# WHY: Label downgrades may indicate policy circumvention or misunderstanding -
# frequent downgrades should trigger additional user training
# -Operations "SensitivityLabelUpdated": Catches label changes (not initial applications)
# WHERE-OBJECT filter: Only includes events where an old label existed (true downgrade)
# OUTPUT: Date, user, and full audit details for each downgrade event
# CONCERN: Investigate spikes - a single user downgrading many labels may be exfiltrating data
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) `
-Operations "SensitivityLabelUpdated" -ResultSize 1000 |
Where-Object { ($_.AuditData | ConvertFrom-Json).SensitivityLabelEventData.OldSensitivityLabelId -ne $null } |
Select-Object CreationDate, UserIds, AuditData# Identify users who have never applied a label
# WHAT: Compares all mailbox users against label audit data to find non-adopters
# WHY: Users who never label content represent a compliance gap - target them
# for additional training or investigate whether they handle any sensitive data
# Step 1: Get all users who HAVE applied labels in the last 90 days
$labelUsers = Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-90) `
-EndDate (Get-Date) -RecordType "MIPLabel" -ResultSize 5000 |
Select-Object -ExpandProperty UserIds -Unique
# Step 2: Get ALL mailbox users in the organisation
$allUsers = Get-Mailbox -ResultSize Unlimited | Select-Object -ExpandProperty UserPrincipalName
# Step 3: Find the difference - users with no label activity at all
$noLabelUsers = $allUsers | Where-Object { $_ -notin $labelUsers }
# Step 4: Export the non-adopter list for follow-up training
# OUTPUT: CSV of users who may need labeling training or workflow integration
$noLabelUsers | Export-Csv -Path "UsersWithoutLabels.csv" -NoTypeInformationIf you are working in a lab or test tenant and need to remove the labels and policies created in this lab:
# LAB CLEANUP ONLY - Do NOT run in production environments
# WHAT: Removes all labels and policies created during this lab
# ORDER MATTERS: Delete in reverse dependency order to avoid orphaned references
# Step 1: Remove auto-labeling policies first (they reference labels)
Remove-AutoSensitivityLabelPolicy -Identity "Auto-Label PII Financial" -Confirm:$false
# Step 2: Remove label policies (unpublishes labels from users' Office apps)
Remove-LabelPolicy -Identity "Global Label Policy" -Confirm:$false
# Step 3: Remove sub-labels BEFORE parent labels (children must go first)
Remove-Label -Identity "Confidential-AllEmployees" -Confirm:$false
Remove-Label -Identity "Confidential-Finance" -Confirm:$false
Remove-Label -Identity "Confidential-HR" -Confirm:$false
Remove-Label -Identity "Confidential-Legal" -Confirm:$false
# Step 4: Remove parent labels last
# WARNING: Encrypted content using deleted labels may become permanently inaccessible
Remove-Label -Identity "Confidential" -Confirm:$false
Remove-Label -Identity "Highly Confidential" -Confirm:$false
Remove-Label -Identity "General" -Confirm:$false
Remove-Label -Identity "Public" -Confirm:$false| Resource | Description |
|---|---|
| Learn about sensitivity labels | Overview of sensitivity label capabilities |
| Create and configure sensitivity labels | Step-by-step label creation guide |
| Sensitivity labels in Office apps | End-user experience in Word, Excel, PowerPoint, Outlook |
| Apply a sensitivity label automatically | Auto-labeling policy configuration |
| Restrict access with encryption | Configure encryption and rights management with labels |
| Enable sensitivity labels for files in SharePoint and OneDrive | Enable label support for collaboration |