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()
$web.NoCrawl = $true
instead of calling it on the$ctx