Sharepoint Office 365会自动添加指向大多数查看过的网页的链接。如何防止它。很难隐藏“网站设置”中每个新出现的链接>导航设置。谢谢!
答案 0 :(得分:0)
您可以通过 SharePoint CSOM API 从左侧导航中删除Recent
节点。
以下示例演示了如何从PowerShell中的左导航中删除Recent
节点:
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"
Function Get-Context([string]$Url,[string]$Username,[string]$Password){
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword)
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$ctx.Credentials = $credentials
return $ctx
}
Function Delete-NavigationNode([Microsoft.SharePoint.Client.Web]$Web,[string]$NodeTitle){
$ctx = $Web.Context
$nodes = $Web.Navigation.QuickLaunch
$ctx.Load($nodes)
$ctx.ExecuteQuery()
$node = $nodes.GetEnumerator() | where { $_.Title -eq $NodeTitle } | Select -First 1
$node.DeleteObject()
$ctx.ExecuteQuery()
}
$Url = "https://contoso.sharepoint.com/"
$Username = "jdoe@contoso.onmicrosoft.com"
$Password = ""
$ctx = Get-Context -Url $Url -Username $Username -Password $Password
Delete-NavigationNode -Web $ctx.Web -NodeTitle "Recent"