0

I've spent hours looking at solutions to this high priority issue, using PNPOnline, Sharepoint Online Management Shell, and CSOM, and whenever I try anything using nocrawl, it tells me the property doesn't exist. It seemed like a pretty straightforawrd request (as they always do before disaster strikes), but I'm not familiar enough with SharePoint to know what I'm missing. Any help is appreciated

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"
$siteUrl = "url of my site"
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$credentials= Get-Credential
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credentials.Username, $credentials.Password)
$web = $ctx.Web
$ctx.NoCrawl = $True
$ctx.Update()
$ctx.ExecuteQuery()

enter image description here

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.