How to enable site classification in modern SharePoint site

Manimekalai
 
Technology Specialist
August 23, 2018
 
Rate this article
 
Views
4800

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 FilesSharePoint Online Management ShellSharePointPnPPowerShellOnline"
         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"
 $UserName="test@123.onmicrosoft.com"
 $pwd ="********"
 $siteURL="https://<<tenant>>.sharepoint.com"
 $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.

Thanks!

Author Info

Manimekalai
 
Technology Specialist
 
Rate this article
 
Having 6 years of experience in design and development of SharePoint applications, Mani has expertise in developing applications using Office 365, SharePoint 2013 & 2010, SPFX, SP Designer Workflows, Visual ...read more
 

Leave a comment