how to access Search and Offline Availability in office 365
-
24-12-2020 - |
Question
how to access Search and Offline Availability in office 365, to disable search results ?
La solution
Since August 2016, the ExcludeFromOfflineClient
property is exposed via CSOM.
Ensure that you have that latest CSOM dll or atleast a version after August 2016.
After that you can run the below script in SharePoint online powershell to set the search and offline availability:
Add-Type -Path "<insert path>\Microsoft.SharePoint.Client.dll"
Add-Type -Path "<insert path>\Microsoft.SharePoint.Client.runtime.dll"
# Variables with prompts
$siteUrl = Read-Host -Prompt "Enter Site Collection URL"
$username = Read-Host -Prompt "Enter username"
$password = Read-Host -Prompt "Enter password" -AsSecureString
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$ctx.Credentials = $credentials
$rootWeb = $ctx.Web
$ctx.Load($rootWeb)
$ctx.ExecuteQuery()
# Update root site
$rootWeb.ExcludeFromOfflineClient=$true
$rootWeb.Update()
$ctx.Load($rootWeb)
$ctx.ExecuteQuery()
Autres conseils
You can disable the site from appearing on search results by doing the following:
- On the site, click Settings > Site Settings
- Under Search, click Search and offline availability
- At Indexing Site Content select No
- Save the changes
This defines, that the site will not be visible in the search results. Note, that this also affects the subsites below the site if there are any.
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange