10

We have got a web application with 400 site collections and multiple sites, is there a way to turn off the MDS feature for entire web application?

2 Answers 2

8

You can try below code to Deactivate MDS feature for entire web application.

$webApp = Get-SPWebApplication -Identity http://sp2010
$siteCollection =$webApp | Get-SPSite -limit all 

foreach ($site in $siteCollection)
{
$webs = $site | Get-SPweb -limit all
foreach ($web in $webs)
    {
    $url = $web.URL
    write-host "Web URL = " $url -foregroundcolor "blue"
    Disable-SPFeature -Identity  "87294c72-f260-42f3-a41b-981a2ffce37a" -url $url -Confirm:$False
    }

}
3
  • 1
    shouldnt it be disable? the last line.
    – variable
    Apr 7, 2014 at 6:49
  • Thnx for poiting out ..edited
    – Unnie
    Apr 7, 2014 at 10:04
  • 1
    If you really have a lot of webs, you should consider using the -Confirm:$False parameter with Disable-SPFeature to avoid prompting each time.
    – pholpar
    Nov 3, 2014 at 7:04
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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