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
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
}
}
-
1
-
-
1If you really have a lot of webs, you should consider using the -Confirm:$False parameter with Disable-SPFeature to avoid prompting each time.– pholparNov 3, 2014 at 7:04
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