This document explains what eSHARE Classify achieves in SharePoint Online and OneDrive, and the order in which to set it up: install the Data Classification Menu, then add the eSHARE classification columns to every site, library and OneDrive. The following steps will be reviewed:
PREREQUISITES:
eSHARE must already be connected to your Microsoft 365 tenant. See Create eShare Entra ID App Registration.
What eSHARE Classify Does
eSHARE Classify lets users apply your organization's data classification to files in SharePoint, OneDrive and Teams: a sensitivity label plus data markings, such as IP Marking: YES or CUI Marking: YES. Users classify a file in one of two ways:
Data Classification Menu: the 'Data Classification' option on a file's menu in SharePoint, OneDrive and Teams. It works for any file type, including PDFs.
Data Classification Add-in: the 'Data Classification' panel in Word, Excel and PowerPoint, which also stamps the markings into the document's header and footer.
eSHARE writes the classification into classification columns on the file's library. Once it is there, your organization can act on it:
Who | What they get |
|---|---|
Users | See each file's classification in the library and in the file's 'Details' pane, and filter or sort files by it |
Administrators | Find classified files with SharePoint search |
Security and compliance teams | Use the classification in Microsoft Purview Data Loss Prevention (DLP) policies, for example to warn users or block external sharing of files with a given classification |
eSHARE can only write to a library that already has the columns. If a library doesn't have them, the classification isn't stored there and DLP can't see it. That is why the setup adds the columns to every site, library and OneDrive, and to new sites as they are created.
Setup Steps
Follow these articles in order. Steps 3 and 4 run eSHARE scripts that read and add the columns; every script runs in Report mode first, which writes an Excel report of what would change and changes nothing.
Data Classification Menu Installation Guide: install the Data Classification Menu in SharePoint, OneDrive and Teams, and upload the configuration file that defines your attributes and markings. To also classify from Word, Excel and PowerPoint, install the Data Classification Add-in.
Create eSHARE Classify SPO Columns Entra ID App Registration: the app, certificate and permissions the column scripts sign in with, plus the tenant configuration file.
Run the SharePoint Column Inventory: a read-only list of the columns already in the tenant, to find existing classification columns before deploying.
Deploy the eSHARE Classification Columns: add the columns to every SharePoint site and library, then to every OneDrive.
Add the Classification Columns to New Sites: check the default site templates the deployment sets up, so new sites get the columns automatically.
The Classification Columns
The deployment adds five columns to every document library, with the same names and IDs on every site:
Column | Internal name | What it holds | Shown in the library view |
|---|---|---|---|
Data Sensitivity |
| The sensitivity label, e.g. Confidential | Yes |
Data Classification |
| The classification ID. Purview DLP rules match on this value. | Yes |
Data Attributes |
| The markings the user selected, e.g. IP Marking: YES, CUI Marking: YES | Yes |
eSHARE_GUID |
| The classification ID saved inside Office files by the Data Classification Add-in | No |
Data Sensitivity Id |
| The ID of the sensitivity label | No |
All five are Single line of text site columns in the group eSHARE Classification. The two hidden columns are still on every library: they show in the details pane, are indexed by search, and users can add them to a view.
Note:
Don't create these columns by hand. eSHARE finds them by their internal name, and a column created in the SharePoint UI as Data Sensitivity gets the internal name Data_x0020_Sensitivity. A column added to a single library also doesn't get the search property that DLP rules use.
Who Needs to Be Involved
Role | What they do | When |
|---|---|---|
Application Administrator, Cloud Application Administrator or Global Administrator | Installs the Data Classification Menu, and creates the app registration for the column scripts | Steps 1 and 2, and when the certificate is renewed |
Global Administrator or Privileged Role Administrator | Grants admin consent to the app registration's permissions | Step 2 |
eSHARE Administrator | Uploads and activates the Data Classification configuration file in the eSHARE Admin Console | Step 1 |
SharePoint Administrator | Runs the column scripts, reviews the reports and approves the changes | Steps 3 to 5, and each later run |
eSHARE Customer Success | Can run the steps with your administrators on a call and help read the reports | Optional, on request |
The column scripts sign in as the app registration, not as the person running them, so they can reach every site. The person running them needs the certificate on their computer, so keep the scripts and certificate with a small group of administrators.
Decisions to Make Before You Start
How to split SharePoint and OneDrive: the columns go on every SharePoint site and every OneDrive, so files classified in either are covered by DLP. eSHARE recommends doing SharePoint sites first, then OneDrive. You can also do both in one pass, or roll OneDrive out in batches of users. See Choose How to Split the Rollout.
Default site templates: the deployment also registers eSHARE default site templates, so new team and communication sites get the columns automatically. An eSHARE default replaces Microsoft's default for that site type; if your organization already has its own default templates, the eSHARE site script is added to them instead. See Add the Classification Columns to New Sites.
Existing columns with the same name: if a library already has a column with one of the five internal names, the deployment replaces it with the standard site column. Its values are backed up and restored, and the files' 'Modified' dates don't change.
App permissions: the app registration for the column scripts needs the SharePoint Sites.FullControl.All and Microsoft Graph Sites.Read.All application permissions.
Prepare the Workstation
The column scripts run on Windows, macOS or Linux. These articles use Windows, the example tenant name contoso and the folder C:\eSHARE-Classification. Replace contoso with your own tenant name wherever it appears.
The eSHARE scripts are the same for Commercial, GCC and GCC High tenants: they read the cloud from the tenant configuration file and connect to the right endpoints. Where a command you type yourself differs, the articles show a 'Commercial and GCC' version and a 'GCC High' version; use the one for your tenant.
Install PowerShell 7.4 or later from a command prompt. Windows PowerShell 5.1 is not supported.
winget install --id Microsoft.PowerShell --source wingetOpen 'PowerShell 7' from the Start menu and install the required modules:
foreach ($m in 'PnP.PowerShell', 'Microsoft.Graph.Authentication', 'Microsoft.Graph.Sites', 'ImportExcel') {
if (-not (Get-Module -ListAvailable -Name $m)) { Install-Module $m -Scope CurrentUser }
}Create the folder the scripts and reports will live in:
New-Item -ItemType Directory -Path C:\eSHARE-Classification -Force | Out-NullThere is nothing to download. Each article includes the eSHARE script it uses, with a copy button, and shows how to save it in this folder.
Note:
Errors that start with At line: and show CategoryInfo mean the command ran in Windows PowerShell 5.1. Type
pwshto switch to PowerShell 7. If a command fails with Could not load file or assembly, open a new PowerShell 7 window and runImport-Module PnP.PowerShellbefore anything else. If your organization's execution policy blocks the eSHARE scripts, runSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypassin the same window first, or ask your IT team.