locked
Disabling Minimal Download Strategy from PowerShell but still shows feature as "Activated". RRS feed

  • Question

  • I have an interesting issue with the Minimal Download Strategy feature in SharePoint 2013. I have a script in place which will disable this feature on all sites in all site collections on our Farm. The script has been working fine and we schedule it to run daily at 8PM so that any new sites that get created will have this feature shut off, in case the person who created it forgot to disable it.

    As of recently, I've noticed while the script appears to be working fine, we are seeing that new sites are still showing the feature as activated in the "Manage Site Features" page. If I re-run the script, it shows that the feature is disabled and won't do anything. The script basically steps through all sites of all site collections in our default web application and if the MDS feature is enabled it disables it. Simple enough.

    So why am I now seeing sites that show the feature is Activated even though it is disabled? I've checked this by noting the URL that the site uses and it does not load pages from the "_layouts/15/" location. 

    The reason we have to turn this feature off on all sites is because we allow external users to access our SharePoint through a secure proxy. With this feature enabled, we have constant problems with pages not loading properly or generating javascript errors.

    Anyone have any insight into this?


    Friday, July 18, 2014 2:55 PM

Answers

  • Hi Joaquin,

    As I understand, you have a custom script for disable Minimal Download Strategy feature in SharePoint 2013. It missed newly created web sites.

    Firstly we should confirm if the issue occurs to custom script or SharePoint UI “Manage Site feature” not displaying truly feature status.

    Please run the command below, see if UI display deactivate for this feature:

    $web = Get-SPWeb http://siteurl

    $web.EnableMinimalDownload = $false

    $web.Update()

    If it works, then the issue might exist in your custom script.

    Here is a link for disabling this feature for all sites:

    http://www.sharepointastic.com/Pages/SharePoint2013MDS.aspx

    Regards,

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


    Rebecca Tu
    TechNet Community Support

    • Marked as answer by Rebecca Tu Monday, July 28, 2014 1:31 AM
    Monday, July 21, 2014 7:47 AM

All replies

  • Hi Joaquin,

    As I understand, you have a custom script for disable Minimal Download Strategy feature in SharePoint 2013. It missed newly created web sites.

    Firstly we should confirm if the issue occurs to custom script or SharePoint UI “Manage Site feature” not displaying truly feature status.

    Please run the command below, see if UI display deactivate for this feature:

    $web = Get-SPWeb http://siteurl

    $web.EnableMinimalDownload = $false

    $web.Update()

    If it works, then the issue might exist in your custom script.

    Here is a link for disabling this feature for all sites:

    http://www.sharepointastic.com/Pages/SharePoint2013MDS.aspx

    Regards,

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


    Rebecca Tu
    TechNet Community Support

    • Marked as answer by Rebecca Tu Monday, July 28, 2014 1:31 AM
    Monday, July 21, 2014 7:47 AM
  • Post the script.
    Monday, July 21, 2014 8:02 AM
  • Here is the script we are using. As I mentioned, it works fine. It disables the the "Minimal Download Strategy", however when you go to the site settings it shows the feature is activated. 

    # This PowerShell script will check all sites of each site collection in
    # the default Web Application to see if the MDS (Minimal Download Strategy) 
    # feature is enabled and if so it will turn it off.

    # This script should be scheduled to run once a day to ensure this feature
    # is always disabled.

    # Register SharePoint Snap-In
    $ver = $host | select version
    if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
    Add-PsSnapin Microsoft.SharePoint.PowerShell
    Set-location $home

    Write-Host "Script Running at "(Get-Date);

    $Default_WebApp = "http://vmsp2k13app.phs.org"

    # Get all Site Collections in the default Web Application
    $SPSites = Get-SPSite -WebApplication $Default_WebApp

    #Cycle through each Site Collection and its Webs (sub-sites)
    ForEach($Site in $SPSites){
    Write-Host "";
    Write-Host "Checking Site-Collection: " $Site.Url;
    ForEach($Web in $Site.AllWebs)
    {
    Write-Host "";
    Write-HOst "    Checking Sub-Site: " $Web;
    If($Web.EnableMinimalDownload -eq 1)
    {
    Write-Host "        Minimal Download Strategy is Enabled for this site!";
    Write-Host "        Disabling....";
    $Web.EnableMinimalDownload = 0;
    $Web.Update();
    }
    Else
    {
    Write-Host "";
    }
    }
    $Web.Dispose();
    }
    $Site.Dispose();

    Tuesday, July 29, 2014 7:36 PM
  • Hi,

    Since you decide to disable Minimal Download Strategy because of the issue when users access SharePoint through proxy, what about disabling Minimal Download Strategy in the masterpage once for all?

    You can add this SharePoint control in master page so that all pages use this masterpage will render the page only in standard mode (not MDS) no matter whehter anyone enable\disable this site feature.

    <SharePoint:PageRenderMode runat="server" RenderModeType="Standard" />

    In the meanwhile, you can also check the reason why secure proxy (firewall) is blocking MDS for external users. Please be aware that for a MDS page HTTP request, a special header named X-SharePoint will be included. In some strict firewall rule defination, only explicit headers are allowed and X-SharePoint header may be blocked. You can capture the live log on the proxy (firewall) and see the reason why MDS pages get error.


    Miles LI TechNet Community Support

    Wednesday, August 13, 2014 3:11 AM
  • PowerShell below will update the current farm “MDSFeature” XML to disable for all newly created site collections and child webs. If you need to support IE8 and older browsers this can be helpful. The feature GUID technically remains active but won’t do anything with missing DLL assembly detail. After desktops upgrade (IE11/Win8) then this change can be reversed with a simple file copy “ORIG” back to “XML.” Hope this helps!

    http://www.spjeff.com/2015/02/13/knee-cap-mds-disable-for-new-and-current-sites/

    # Disable MDS - run once per farm
    # unregister Feature definition from ConfigDB
    Uninstall-SPFeature MDSFeature -Force -Confirm:$false
    
    # backup current Feature XML
    $path = "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\MDSFeature\feature.xml"
    Copy-Item $path "$path-orig"
    
    # modify Feature XML to suppress DLL assembly detail  (still registered, but unable to run)
    [xml] $x = Get-Content $path
    $x.Feature.RemoveAttribute("ReceiverClass")
    $x.Feature.RemoveAttribute("ReceiverAssembly")
    $x.Save($path)
    
    # register Feature to ConfigDB
    Install-SPFeature MDSFeature


    @SPJeff | www.spjeff.com

    Friday, February 13, 2015 5:33 PM