The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi @alok paul
Thank you for reaching out to Microsoft Q&A forum.
If you want to force Classic view for document libraries and lists, you can consider using the following PowerShell like the Q&A propose.
$web = Get-SPWeb $URL
$vlibraryFeatures = $web.Lists | Where-Object {($_.BaseType -eq "DocumentLibrary") -and ($_.Hidden -ne "True")} | Select-Object Title
foreach($vLibraryObj in $vlibraryFeatures){
$vLibraryObjName = $vLibraryObj.Title
$list = $web.Lists[$vLibraryObjName]
$list.ListExperienceOptions = "ClassicExperience"
$list.Update()
}
However, the user can switch back to Modern view if they choose "Exit classic experience".
You can use this PowerShell to disable this.
$site = Get-SPSite http://server/sites/team
$featureguid = new-object System.Guid "E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"
$site.Features.Add($featureguid, $true)
Please try and let me know if it works for you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.