Forum Discussion

Serge de Klerk's avatar
Serge de Klerk
Brass Contributor
Aug 12, 2016
Solved

Document libraries keep reverting to Modern view

Hi all,

 

For some reason, our document libraries keep reverting to the Modern view. On the Site Collection level, I've already set the experience to Classic by default

Site Collection level

I even run the below powershell script which runs without errors, but the modern experience keeps reoccurring.

Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

$webUrl = 'https://ongcsystems.sharepoint.com/' 
$username = Read-Host -Prompt "Enter or paste the site collection administrator’s full O365 email, for example, name@domain.onmicrosoft.com" 
$password = Read-Host -Prompt "Password for $username" -AsSecureString

[Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
$clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)

# To apply the script to the site collection level, uncomment the next two lines.
#$site = $clientContext.Site; 
#$featureguid = new-object System.Guid "E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"

# To apply the script to the website level, uncomment the next two lines, and comment the preceding two lines.
$site = $clientContext.Web;
$featureguid = new-object System.Guid "52E14B6F-B1BB-4969-B89B-C4FAA56745EF" 

# To disable the option to use the new UI, uncomment the next line.
$site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);

# To re-enable the option to use the new UI after having first disabled it, uncomment the next line.
# and comment the preceding line.
#$site.Features.Remove($featureguid, $true);

$clientContext.ExecuteQuery();

Has anyone experienced this as well? 

  • Is the modern view is reverting for particular library or entire tenent site collections!. 

     

    If it is for particular document libraries, check the document library settings "New Experience" status. Still the same issue, log the ticket to MS to check your tenent. 

     

    Share the feedback.

8 Replies

    • Serge de Klerk's avatar
      Serge de Klerk
      Brass Contributor
      Hello Vadivelu,

      Thank you for your response, the issue is now resolved. I turns out that I've checked 4 different document libraries which were always showing in the modern view. When I've checked the library settings, it turned out that an admin changed the experience behaviour for these specific libraries to "New experience" instead of the default "Default experience set by my administrator" which should have been selected. Because I've checked these 4 libraries first, I thought that it must have been for the entire site collection, but it turns out that this settings was changed on a library level for only a certain number of libraries.

      Thank you for the hint! :)
  • Is the modern view is reverting for particular library or entire tenent site collections!. 

     

    If it is for particular document libraries, check the document library settings "New Experience" status. Still the same issue, log the ticket to MS to check your tenent. 

     

    Share the feedback.

  • Could it be a cacheing issue in the browser? that it looks at a setting? have you tried incognito?

    • Using the script above should be enough to not enable new Doc. library UI until you decide to enable it again
      • Serge de Klerk's avatar
        Serge de Klerk
        Brass Contributor
        Yes, I've used this script successfully on some of my customers Sharepoint sites and normally works a treat.

Resources