1

Sticky problem here. All I've seen with Powershell is 2010 code, but I'm on the 365/Online version of Sharepoint.

I need to delete two site columns. I've removed them from everything I could imagine. Emptied both Recycling bins.

Still, all I get is this error:

Site columns which are included in content types cannot be deleted. Remove >all references to this site column prior to deleting it.

Thoughts? I either need to know where it is still sitting, or another way to remove.

Thanks,

Joe

2

Could you test with Powershell, e.g. https://gallery.technet.microsoft.com/Get-Content-Types-with-a-e67b46e6 ?

Do you have subsites/lists where the columns could have been added? I don't think the script above is recursive so you would need to adapt it, along the lines:

$Lists=$ctx.Web.Lists
$ctx.Load($Lists)
$ctx.ExecuteQuery()
foreach($ll in $Lists){
foreach($cc in $ll.ContentTypes)
{

 $column=$cc.Fields.GetByInternalNameOrTitle($NameOrTitle.Trim())
 $ctx.Load($column)  
   $ErrorActionPreference= 'silentlycontinue'
   try
   { 
     $ctx.ExecuteQuery() 
     }
     catch [Net.WebException]
     {
     }

    if($column.Title -eq $NameOrTitle.Trim())
    {
      Write-Host $cc.Name
    }
 }
}      
  • Hey, I deleted my only subsite. I've removed the column from all the Content Types that I could image. What do you mean by "recursive"? I'm being prompted for my password twice in above script and then it fails. – Joe Fedorowicz Sep 14 '15 at 12:29
  • Nevermind, I'm an idiot. – Joe Fedorowicz Sep 14 '15 at 12:41
  • Happy it worked :) – grisha Sep 14 '15 at 19:43
  • Very interesting! Jo, where did you find the reference to this site column in your case? Some list still using it? – Vamsi K K Sep 15 '15 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.