locked
SharePoint 2016 MySite activate branding automatically using feature stapling not working RRS feed

  • Question

  • Hi folks

    I'm trying to automatically apply a custom master page and a spocolor file to new mysite site collections as they get created automatically by users clicking the app launch / waffle menu (on "Site" or "OneDrive"). 

    It's on prem SharePoint 2016 implementation. My feature activates and works fine if manually activated but I need it to work automatically. 

    I followed various tutorials like below which talk about feature stapling and adding a web event receiver

    http://frederik.se/how-to-brand-sharepoint-2013-team-sites-using-feature-stapling-in-vs/
    https://sharepointologic.blogspot.ca/2013/04/branding-sharepoint-2013-my-sites-with.html

    Both of which are very straight forward.

    For some reason my branding feature does NOT get activated automatically to mysites site collections as they get created. Personal sites are setup under /personal managed path. So to test is I just delete my /personal/<username> site collection and click on OneDrive or Sites from the waffle menu / app launcher.

    I made the feature stapler feature to be farm scoped, web app scoped, NOTHING. I stapled it to the SPSPERS#2 web template which is what's indicated in the tutorials above. It's as if the feature stapling is not picked up by SharePoint.

    Did anyone come across this? I'm completely stumped.

    I was reading something related to the order of events that take place during site creation. I don't know if that's the cause?

    Thanks

    PS. I looked thru ULS logs and noticed this (see SPSPERS#10 in bold)

    Site collection creation result Succeeded:True;CreateFromSiteMaster:True;EffectiveCreateFromSiteMaster:True;CreatingSiteMaster:False;Template:SPSPERS#10;Description:This is the personal space of LAST NAME, FIRST NAME. You can use this space to create lists, document libraries to store, organize, and share information with others.

    My elements file looks like this (I've added all the SPSPERS configs). I tried only one, or a few, or all. Farm scoped, Web app scoped - no luck

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#10" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#0" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#2" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#3" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#4" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#5" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#6" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#7" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#8" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS#9" />
      <FeatureSiteTemplateAssociation Id="7f629628-64f4-4066-9451-1aa4b70e33b7" TemplateName="SPSPERS" />
    </Elements>



    Monday, November 21, 2016 10:39 PM

Answers

All replies

  • OK after digging and digging I finally found out why! Microsoft introduced the Fast Site Creation "feature" which does NOT take any of any feature stapling (and possibly other customizations)

    Basically I needed to remove the SPSPERS configs from the site master.

    Disable-SPWebTemplateForSiteMaster -Template " SPSPERS#2"

    Disable-SPWebTemplateForSiteMaster -Template " SPSPERS#10"


    Here are few posts about this

    http://sharepointpaul.blogspot.ca/2015/11/sharepoint-2016-and-fast-site-creation.html

    http://www.c-sharpcorner.com/article/fast-site-collection-creation-feature-in-sharepoint-server-2016/

    http://booden.net/FastSiteCreation.aspx

    I hope somebody finds this useful!

    • Marked as answer by The Profiler Tuesday, November 22, 2016 8:21 PM
    Tuesday, November 22, 2016 8:21 PM
  • Hi,

    Thanks for sharing, It will help others who suck with the problem!

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, November 23, 2016 5:15 AM
  • Hi,

    Even i am facing the same issue in SP2016 , the feature is not automatically getting activated using stapler feature.

    I followed the same tutorials as it is mentioned in the post.

    I tried with site templates like GLOBAL, SPSPERS#2, SPSPERS#3 and SPSPERS#10. Nothing worked for me.

    I checked using powershell, from SPSPERS#2 to SPSPERS#10 all site templates are active.

    can you please guide me how you resolved this issue and what exactly i have to do ?

    I am not getting a clear idea with you answer.

    Should i have to Disable those templates??...then which template id should i use in the elements.xml?

    Sunday, January 15, 2017 11:32 AM