{"id":508,"date":"2019-01-27T22:35:50","date_gmt":"2019-01-28T04:35:50","guid":{"rendered":"http:\/\/zewwy.ca\/?p=508"},"modified":"2019-01-29T20:54:33","modified_gmt":"2019-01-30T02:54:33","slug":"sharepoint-orphaned-content-types-reportserver","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2019\/01\/27\/sharepoint-orphaned-content-types-reportserver\/","title":{"rendered":"SharePoint Orphaned <br>Content Types (ReportServer)"},"content":{"rendered":"<h1><span class=\"ez-toc-section\" id=\"New_Series_SharePoint_Orphaned\"><\/span>New Series! SharePoint Orphaned!<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>The only thing that should be orphaned, is SharePoint itself&#8230;. ohhh ouch,<\/p>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Story\"><\/span><strong>The Story<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>joking aside, our Developer again came by reporting some issues with the newly developed SharePoint site I had migrated for him to test creating some new SharePoint web part apps. He already had his own documentation available when he first did this, good man. Even after we got past the &#8220;how to create a new template from a site with publishing features enabled&#8221;, we were still receiving an error.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Slow_SharePoint_fixed%E2%80%A6_But%E2%80%A6\"><\/span>Slow SharePoint fixed&#8230; But&#8230;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>During this whole process this new site was intermittently responding slowly, it was baffling, and as we dug through the UNLS logs we found the issue, apparently the service account configured to run the Web Application Pool did not get access to the ProfileDB for some reason, after granting the login SPAccess on the ProfileDB it fixed the slow intermittent SharePoint loads&#8230; but sadly we were still receiving errors while attempting to deploy new sites from templates.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_signs_were_clear\"><\/span>The signs were clear<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Looking further in the UNLS logs, and the error itself complaining that content types could not contain special characters&#8230;. A bit more searching pointed us towards the sites content types page&#8230;.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/sdhhbrX.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/sdhhbrX.png\" alt=\"\" width=\"534\" height=\"137\" \/><\/a><\/p>\n<p>Whooops how did I miss this&#8230; (ReportServer Feature&#8230;)<\/p>\n<p>Guess there are the &#8220;special characters&#8221;&#8230;.. ugh, even though the &#8220;Test-SPContentDatabase cmdlet&#8221; returned clean throughout my migration (and all my scripts I have yet to publish).  Guess this one isn&#8217;t picked up by the checker? unno anyway&#8230; what to do about this&#8230;<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_search\"><\/span> The search<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/blog.kenaro.com\/2014\/03\/24\/get-rid-of-orphaned-content-types-in-sharepoint-2013\/\">Source one<\/a>\u2026 too complicated, but interesting&#8230; he sure worked hard, I&#8217;d go this route, but I&#8217;m sure there are easier solutions&#8230; got to be and&#8230; yup.<\/p>\n<p><a href=\"https:\/\/blog.jussipalo.com\/2017\/01\/sharepoint-yet-another-way-to-remove.html\">Source two<\/a> simple\u2026 lets try it&#8230;<\/p>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Solution\"><\/span>The Solution<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>Install the feature, disable it on all web apps deployed on the farm, uninsatall the feature. Nice and simple, and how I usually like it, letting the system do most of the heavy lifting to avoid human error.<\/p>\n<p>So Step 1:  <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/confirmation.aspx?id=52682\">Grab Reporting Service<\/a> installers (my case SharePoint 2016)<\/p>\n<p>Step 2: Install it;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/KnbgdGS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/KnbgdGS.png\" alt=\"\" width=\"616\" height=\"144\" \/><\/a>Next, Accept the EULA, Install<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/t9ZPvSq.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/t9ZPvSq.png\" alt=\"\" width=\"501\" height=\"386\" \/><\/a><\/p>\n<p>Success.<\/p>\n<p>This makes the content type names behave correctly.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/vSCJWjX.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/vSCJWjX.png\" alt=\"\" width=\"511\" height=\"102\" \/><\/a><\/p>\n<p>Step 3: Enable it;<\/p>\n<pre><em>Install-SPFeature -Path \"C:\\Program Files\\Common Files\\microsoft shared\\Web Server Extensions\\16\\TEMPLATE\\FEATURES\\ReportServer\"<\/em><\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/9BRAM3L.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/9BRAM3L.png\" alt=\"\" width=\"1171\" height=\"455\" \/><\/a><\/p>\n<p>Now the original post said to simply Uninstall it after, but as you can see it will error, why cause, as it clearly states it&#8217;s still enabled so&#8230;<\/p>\n<p>Step 4: Disable the feature on all web applications<\/p>\n<pre>Disable-SPFeature \u2013Identity ReportServer \u2013Url http:\/\/spsite.domain.com<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/gZmONR3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/gZmONR3.png\" alt=\"\" width=\"899\" height=\"144\" \/><\/a><\/p>\n<p>Step 5:  Uninstall the Feature:<\/p>\n<pre>Uninstall-SPFeature -Identity e8389ec7-70fd-4179-a1c4-6fcb4342d7a0<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/ZpKXDLF.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/ZpKXDLF.png\" alt=\"\" width=\"1164\" height=\"121\" \/><\/a><\/p>\n<p>Step 6: Uninstall the package:<\/p>\n<pre>msiexec \/uninstall rsSharePoint.msi<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/CGEg0YJ.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/CGEg0YJ.png\" alt=\"\" width=\"565\" height=\"202\" \/><\/a><\/p>\n<p>I recommend to do this after hours and on a test first. It did seem to do a IISRESET as all sites had to reload, and took a lil bit for the .NET assemblies to recompile. \ud83d\ude00<\/p>\n<p>Now go enjoy a coffee. Thx, Jussi Palo!<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Second_Solution\"><\/span>The Second Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>OK, not gonna lie, I assumed it was all good, and that assumption came to bite me in the ass&#8230;. again, never assume.<\/p>\n<p>So I told my dev that I had completed the steps and should have no issues creating a new site from his template, but as I&#8217;m walking down the hall a short time later, he give me the snap fingers (like it worked) and says, &#8220;same error&#8221;.<\/p>\n<p>Ughhhhh&#8230; what&#8230;<\/p>\n<p>So looking back at the Sites Content Types the Report Model Document content type still remained&#8230; ok what the&#8230;.<\/p>\n<p>So running through the proceedure again, it cmplained stating the feature was not available for my web apps, so I re-enabled it, saw all three content types, disabled it&#8230; and report model still there&#8230;. :@ c&#8217;mon! Let&#8217;s just delete the content type!<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/apfB964.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/apfB964.png\" alt=\"\" width=\"940\" height=\"287\" \/><\/a><\/p>\n<p>Can never give me a break eh SharePoint&#8230;<\/p>\n<p>Luckily my dev is super awesome and told me about another blog he had read (sorry I don&#8217;t have the source) and told me that the only reason the front end actually refuses to let you delete the content type, isn&#8217;t so much that it&#8217;s tied to an actual feature (even though we all know that this one did come from the ReportServer feature), but rather that it simply has a flag set on it in the table for it&#8230;<\/p>\n<p>Now I normally never recommend making changes on any SharePoint Database stuff directly, and usually always recommend making all required changes via either the Central Admin\/psconfig, site settings or PowerShell. However in this case we clearly installed the proper dependencies, de-activated the feature that populates those content types yet was not being removed from the content databases&#8230;<\/p>\n<p>Only do this if you have tried everything else, only do this in a test environment, actually never do this&#8230;. well I guess if you have tried everything else this is your only option&#8230;<\/p>\n<p>This requires you to have syadmin rights on the SQL Server instance hosting the SharePoint Content Databases. Open SSMS&#8230;<\/p>\n<pre>SELECT *\r\nFROM WSS_CONTENTDB.[dbo].ContentTypes\r\nWHERE Definition LIKE '%Report%'<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/Vbj2ZgT.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/Vbj2ZgT.png\" alt=\"\" width=\"628\" height=\"86\" \/><\/a><\/p>\n<p>Find the row which contains the ID for the Report Builder Content Type (Or which ever other system based content type you have orphaned needs removing). usually easily spotted as it&#8217;ll be the only one with 1 under<\/p>\n<pre>USE WSS_CONTENTDB\r\nGo\r\nUPDATE dbo.ContentTypes\r\nSET IsFromFeature = 0\r\nWHERE ContentTypeID = *ID From above Query*<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/wyIRuMw.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/wyIRuMw.png\" alt=\"\" width=\"506\" height=\"171\" \/><\/a><\/p>\n<p>Now you can go into the actual orphaned Content Type under Site Settings and watch the delete content type not fail or error, and destroy that content type from your SharePoint life!<\/p>\n<p>*Note* My Dev came back saying same error again, lol, but this time it was discovered we simply had to re-create the template and deploying the template from new worked (which originally didn&#8217;t before the above changes)<\/p>\n<p>Happy SharePointing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>New Series! SharePoint Orphaned! The only thing that should be orphaned, is SharePoint itself&#8230;. ohhh ouch, The Story joking aside, our Developer again came by reporting some issues with the newly developed SharePoint site I had migrated for him to test creating some new SharePoint web part apps. He already had his own documentation available &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2019\/01\/27\/sharepoint-orphaned-content-types-reportserver\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SharePoint Orphaned <br \/>Content Types (ReportServer)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[8,9],"tags":[149,140],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-server-administration","category-sharepoint","tag-orphaned-content-types","tag-sharepoint"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":5,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/508\/revisions\/513"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}