How to enable site classification in modern SharePoint site

Technology Specialist
Published On :   23 Aug 2018
Visit Count
Today :  5    Total :   855

The site classification option is not enabled by default in modern site, and you need to configure it using either CSOM or PowerShell script.

Site classification is basically used to define the sensitivity of the data. So, you can use the below script is used to enable the site classification on the tenant level

 Write-Output -msg "Start : Module loading Process"
 $modulePath = "C:\Program Files\SharePoint Online Management Shell\SharePointPnPPowerShellOnline"
         Add-Type -Path ($modulePath + "\SharePointPnP.PowerShell.Online.Commands.dll")
         Add-Type -Path ($modulePath + "\Microsoft.SharePoint.Client.dll")
         Add-Type -Path ($modulePath + "\Microsoft.SharePoint.Client.Runtime.dll")
         Add-Type -Path ($modulePath + "\Microsoft.Online.SharePoint.Client.Tenant.dll")
 Write-Output -msg "End : Module loading Process"
 $pwd ="********"
 $Credentials = New-Object Microsoft.SharePoint. Client.SharePointOnlineCredentials($UserName, (ConvertTo-SecureString $pwd -AsPlainText -Force))
 $encpassword = convertto-securestring -String $pwd -AsPlainText -Force
 $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $UserName, $encpassword
 Connect-PnPOnline -Url $siteURL -Credentials $cred
 Write-Output $siteURL
 Connect-PnPOnline -Scopes "Directory.ReadWrite.All"
 Enable-PnPSiteClassification -Classifications "HBI","LBI","Top Secret" -UsageGuidelinesUrl $siteURL -DefaultClassification "HBI"

After you have enabled this site classification, you see an additional field How sensitive is your data while creating modern team or communication site.