Disable Mobile View on all SPWeb

Param([string]$WebUrl) if($WebUrl -eq ""){ write-host "Please input `$WebUrl` parameter value." -ForegroundColor Red; exit -1 } [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null $WebApp = Get-SPWebApplication $WebUrl foreach($site in $WebApp.Sites){ foreach($web in $site.AllWebs){ $WUrl = $web.Url; Write-Host "Disabling mobile view on web - $WUrl..." -ForegroundColor Gray -NoNewline Disable-SPFeature -identity "d95c97f3-e528-4da2-ae9f-32b3535fbb59" -URL $WUrl -Force -Confirm:$false -ErrorAction SilentlyContinue write-host "done." -ForegroundColor Green } } Write-Host "End of exection" -BackgroundColor Green -ForegroundColor White