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!
Leave a comment