The field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948} defined in feature {6e1e5426-2ebd-4871-8027-c5ca86371ead} was found in the current site collection or in a subsite

I’m writing this post today; because The field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948} defined in feature {6e1e5426-2ebd-4871-8027-c5ca86371ead} was found in the current site collection or in a sub-site.

this was what happened, and if you don’t want to know the history behind this blog post or how to interrogate the object model, and just want to identify the sites inside your site collection where this is happening when you try to enable the “Video and Rich Media” feature, then just run this one-liner.videorich

 

Document, Document, Document

I had meant to write this post a few weeks back. At that time, I had enough forethought to show one of the junior SharePoint admins how to interrogate the object model, and luckily she was able to remember that it was the “field” property that I needed to look for, and not the “feature” property. Thank God that she remembered, because I had completely “spaced” (aka forgotten) on the procedure of what I had done a few weeks or months back (I cant recall how long it was) when this happened.  I was having a “senior moment”.  It was at this time that we almost had what some might call, “A when the student becomes the teacher” situation\moment.  It sure seemed that way, anyways….

You could make a reusable function if you wanted too, with powershell.  But hopefully, your environment is not in such an unstable and ungoverned state to even need such a thing. If you do live and work in a “wild west SharePoint” then you might want to write a simple loop that iterates through the web application or site collection.  One like the neophyte script below, where everywhere that you see a  “/”, is where the feature is activated at the root level of the site collection; but, is not active anywhere else in any of the sub-sites.  It doesn’t indicate use, necessarily.

Here’s a script that you can use, but be forewarned, this script shows where the feature is activated, and where it has dependencies:

 

Just replace “Your web application url” with your web application url.

The output will show you every root site collection where the feature is activated and it will also show you sub-sites that use the feature, or have fields based on content types from the feature.  You’ll still need to get deeper into each sub-site if there is an issue.

What causes this chaos?  Why?

My first thought for what causes this is immature administration.  Or simply put, people who have not had enough training and are given site collection admin privileges, or worse yet, farm admin privileges.  These people then decide to start “turning knobs” on the proverbial dashboard of dads car “the site collection features page” _Layouts/ManageFeatures.aspx?Scope=Site (but, hey take that in the analogy of a car parked on a sloped drive, …that’s how you learn what an emergency brake is for, right?).

 

Speaking of which, cool sharepoint url’s, (not e-brakes), this is a great blog on the subject of SharePoint URLs that could make you look like a freaking genius! -> https://blogs.msdn.microsoft.com/how24/2013/05/23/famous-sharepoint-urls-locations/

Another cause for this issue of being unable to “freely enable/disable” aka activate the site collection feature, could be that it might have been active before the import.  And then, someone, with infinite SharePoint wisdom, the type unmatched by any  knowledgeable SharePoint admin, came behind and decided to deactivate the feature, after a site with fields that use the “Video and rich media” were imported.  This will cause the Site collection feature fail on activation, without using a force parameter.

In other words, once a site or sub-site is actively using this feature in some, or one of its fields, when you deactivate the site collection feature, after it is active in a sub-site or site, and then try to activate the feature, it will still throw the error and will not “freely enable/disable” err activation will fail.  You could forcefully enable the feature with Enable-SPFeature, e.g.; but, this is usually a bad idea.  Reason is that the feature should be there before being used in the subsites.

How to interrogate the Site Collection and find the field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948}  

The SharePoint management shell has all the information about this that you want.  You need to look for the field id within the site collection.  Once you find the field in use, you can even see what list the field is associated with.  The site below has a list named “userInfo” and in that list, there’s a field that was originally named “VideoSetOwner” and then that name was later changed to a display name of “Owner”, by SharePoint during creation; because, Site collection admins never do this sort of thing.

videorich7

 

videorich8

You can see that the SchemaXmsWithResourceTokens property clearly displays the Field ID {2de1df7b-48e1-4c8e-be0f-f00e504b9948} that you’re looking to find in use.

The meat of it

The problem statement, for this issue, is the title of this blog – The field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948} defined in feature {6e1e5426-2ebd-4871-8027-c5ca86371ead} was found in the current site collection or in a sub-site.

You know what site collection you’re working with, but you need to find the sub-site.  Err, You already know what site collection the sub-site is located inside of, after all you just tried to activate the feature at the site collection. This action of trying to activate Video and Rich Media occurred maybe after importing a site with the field inside of it (unbeknownst to you because you didn’t check the source site collection features before you performed the import and SharePoint didn’t give you any alarms on the import) or perhaps you just tried to activate the site collection feature after someone deactivated the site collection feature.  Who knows, the ungoverned SharePoint world is a scary place.  One thing you do need to get a handle on, though, is what to do with it, once you find it.

For example, if the image above that shows “/Maps” for the scope had shown “/” as the scope, then that would indicate that the field with the offending content type was already present in a field in a list inside the site collection, or activated in the site collection.  This is why, it’s not always as easy as just exporting a sub-site, activating the feature, and then importing it.  Ergo, sometimes you have to export and import the offending list, versus the entire site.

If you run Get-SPSite http://somesite | Get-SPWeb -Limit ALL | Where-Object { Get-SPFeature -Web $_ } | Select DisplayName,ID -Unique, as recommended on Microsoft technet https://technet.microsoft.com/en-us/library/ff607945.aspx  you’ll get “the name and identifier (ID) of each uniquely enabled Feature on every SPWeb object in the site collection at http://somesite.” that is scoped to the “web” (notice: the -Web $_ this indicates just show me web scoped features).

Interrogation

Run (Get-SPSite “URL to your Site collection”).features

it will list out all the features in your site collection

if you look at the methods and properties of the Get-SPSite cmdlet by piping that to get-member a.k.a “gm” you’ll notice that one of the properties is “Features”, this is true for Get-SPWeb as well.

For example,

 

will return all the methods and properties that you can harness, with Get-SPSite piped to Get-SPWeb,

the main property that we need it named “Fields” – -man who would’ve thought? <–insert sarcasm here please

So now that you have this property named “Fields” and you’re almost sure this is what you’re after, you just need to look at it to be 100%.

You want to make sure you can identify everything, after all you want the whole enchilada.  So, you pipe that into Get-SPWeb, so as to find any fields inside of sub-sites.

Get-SPWeb finds all the web (a.k.a. sites and sub-sites) within a site collection and returns properties from those sites.

Features are scoped

Features are scoped either to the Farm (FARM), the Site collection (SITE) or to the site (WEB).  Here’s a great post that enumerates all the various features, scopes, etcetera: http://social.technet.microsoft.com/wiki/contents/articles/18729.sharepoint-2013-list-of-features-id-displayname-compatibilitylevel-and-scopes.aspx

So, when you’re looking for, and I quote, “the field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948} defined in feature {6e1e5426-2ebd-4871-8027-c5ca86371ead}” that was found in the current site collection or in a sub-site, you need to first get the site collection, then pipe that to a cmdlet that is capable of getting all the sites (aka webs) inside that site collection.  Then you can pipe that to a table to show you just the ID and the scope. (note: hopefully it’s not scoped to a site collection and giving the error)

Run this bad boy:

 

When troubleshooting this, if you pipe the output of (Get-SPSite “URL to your Site collection” | Get-SPWeb -limit all).fields | ? {$_.ID -eq “2de1df7b-48e1-4c8e-be0f-f00e504b9948”} to the out-file commandlet, you’ll be able to  use ctrl+h on the text file to quickly find the 2de1df7b….  then once you find it, you can determine what list it’s located inside of.  This is important when the offending field is inside of the site collection, right?  After all, you’re not going to delete the entire site collection,or are your? Then re-import..etc..that’s just insanity, right?????

So output the meat of it, and you’ll see where the “Features are scoped”, even the list they’re inside of, and not just a couple of properties,

 

videorich6

For example, once the text is exported, you can see the scope and the name of the list “UserInfo”.

 

videorich2

videorich5

 

In closing, I hoped this help shed some light on “The field with Id {2de1df7b-48e1-4c8e-be0f-f00e504b9948} defined in feature {6e1e5426-2ebd-4871-8027-c5ca86371ead} was found in the current site collection or in a subsite” – SharePoint ULS logging system and on how you can drive into the object model to find the “Fields” <- pun intended, that you’re looking for…have a great day!

 

 

 

 

Leave a Reply