Wednesday, November 22, 2017

Switch the default experience for lists or document libraries from new or classic

Switch the default experience for lists or document libraries from new or classic

You may notice a change in the look and navigation of your document libraries and lists. This new experience is faster, has additional phone and tablet features, and simpler navigation. As a document library or list owner, site owner, or administrator, you may want to switch the default experience back to the previous (classic experience) for a time. Keep in mind that users can change the experience in specific libraries or sites back to new if they choose. A change to settings at the library and list level overrides changes at the site, site collection, and tenant level.

Note: This article is for library and list owners and admins who want to change the default experience for users. If you an individual user and you want to return to classic experience, click Return to classic SharePoint in the bottom, left corner of the page. To exit the classic experience, click Exit classic experience in the bottom, left corner of the page.

  1. In your list or document library, choose Settings Settings icon and then List settings or Library settings.

    Go to Settings, Library Settings

    If you don't see Settings Settings icon , choose the Library or List tab to open the ribbon, and then click Library Settings or List Settings on the ribbon.

    List Settings on ribbon
  2. Click Advanced settings and then scroll down to List experience.

    List and Library setting

  3. Choose one of the following:

    • Default experience set by my administrator

      This option sets the experience as whatever your site administrator set.

    • New experience

      This option sets the experience to the new experience. This experience is on by default, so you would choose it only if you are switching back from classic.

    • Classic experience

      This option sets the experience to classic, which is the previous, older experience for document libraries.

  1. Sign in to Office 365 as a global admin or SharePoint admin.

  2. Select the app launcher icon The icon that looks like a waffle and represents a button click that will reveal multiple application tiles for selection. in the upper-left and choose Admin to open the Office 365 admin center. (If you don't see the Admin tile, you don't have Office 365 administrator permissions in your organization.)

  3. In the left pane, choose Admin centers > SharePoint.

  4. Choose settings.

  5. Next to SharePoint Lists and Libraries experience, select either Classic experience or New experience (auto-detect).

    Setting for default List and Library experience

Check for customizations that affect lists or library pages

One reason you may want to change the default experience at the site and site collection level is because you have customizations that affect list or library pages and represent business-critical functionality. If you want to check for these kinds of customizations to help you determine which sites and site collections you want to change the default for, you must use a Windows PowerShell script with a CSOM (Client-side object model) wrapper. The following script detects customactions that deploy custom scripts.

  1. Verify that you meet the following minimum requirements:

  2. Copy the following code and paste it into a text editor, such as Notepad. For this article, we will name the script file, CustomActions.ps1.

    Notes: 

    • This script needs to be run separately for each website you want to check CustomActions for. The placeholder names indicated in < > need to be change to meet your organizational requirements.

    • There are commented lines, denoted by the pound sign (#), in the sections of script for site collection level and site levels. To run the appropriate script, remove the pound sign (#) in front of the lines in the section that you want to change the experience for.

      # This file uses CSOM. Replace the paths below with the path to CSOM on this computer.  # If CSOM is in the user's downloads folder, you only have to replace the <username> placeholder.    Add-Type -Path "C:\Users\<username>\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.dll"  Add-Type -Path "C:\Users\<username>\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll"    # All strings in braces < >are placeholders that you must replace with the appropriate strings.    $webUrl = 'https://<domain>.sharepoint.com/<relative-path-to-website>'  $username = '<username>@<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)  $site = $clientContext.Site;  $customActions = $site.UserCustomActions  $clientContext.Load($customActions)  $clientContext.ExecuteQuery()    $first = $true  foreach($customAction in $customActions)  {      if($customAction.Location -eq "scriptlink" -and -Not ([string]::IsNullOrEmpty($customAction.ScriptBlock)))      {          if ($first)          {              Echo " "                  Echo ($webUrl + " has the following inline JavaScript custom actions")          $first = $false          }          Echo $customAction.Title      }  }  
  3. Save the file, naming it CustomActions.ps1.

    Note: You can use a different file name, but you must save the file as an ANSI-encoded text file whose extension is .ps1

  4. Change to the directory where you saved the file.

  5. At the Windows PowerShell command prompt, type the following command:

    ./CustomActions.ps1

Change the default experience for sites and site collections

To change the default experience for document libraries on a site collection or site level, you must use a Windows PowerShell script with a CSOM (Client-side object model) wrapper, as follows.

  1. Verify that you meet the following minimum requirements:

  2. Copy the following code and paste it into a text editor, such as Notepad. For this article, we will name the script file, DocLib.ps1.

    Note: There are commented lines, denoted by the pound sign (#), in the sections of script for site collection level and site levels. To run the appropriate script, remove the pound sign (#) in front of the lines in the section that you want to change the experience for.

      ##The first two lines of the script load the CSOM model:  Add-Type -Path "C:\Users\{username}\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.dll"    Add-Type -Path "C:\Users\{username}\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll"    $webUrl = 'https://{domain}.sharepoint.com/[optional path to subweb]'  $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 turn off the new UI by default in the new site, 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();    
  3. Save the file, naming it DocLib.ps1.

    Note: You can use a different file name, but you must save the file as an ANSI-encoded text file whose extension is .ps1

  4. Change to the directory where you saved the file.

  5. At the Windows PowerShell command prompt, type the following command:

    ./DocLib.ps1

For additional information about Windows PowerShell, see Using Windows PowerShell.

No comments:

Post a Comment