SharePoint Online 切换经典视图
资讯类别:SharePoint开发发布日期:2018-01-31 10:24:00      浏览次数:661 次
北京博皓科技有限公司:提供全面的SharePoint开发资讯

  sharepoint online 默认是现代视图,我们可以通过Powershell命令切换默认视图。

  以下,是完成的Powershell命令:

# 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
    }
}

  如果保存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

  参考

https://support.office.com/en-us/article/Switch-the-default-experience-for-lists-or-document-libraries-from-new-or-classic-66dac24b-4177-4775-bf50-3d267318caa9

北京博皓科技有限公司:提供全面的SharePoint开发资讯
展开
  • 在线咨询

  • 北京博皓科技有限公司WEB客服
  • 电话咨询

  • 13693577495