This sample helps to understand how to iterate through all the sub sites in the site collection using PnP PowerShell commands, and also to deactivate a feature in all the sub-sites in the site collection. For this, we will deactivate "Mobile Browser View" feature. It will really come handy when you are trying to make your existing site collection responsive.
- Office 365 Multi-Tenant (MT)
- Office 365 Dedicated (D)
- SharePoint 2013 on-premises
PnP PowerShell Commands
To use the script
.\Deactivate-MobileBrowerView.ps1 -Url https://yoursitecollectionURL
To force deactivation
.\Deactivate-MobileBrowerView.ps1 -Url https://yoursitecollectionURL -Force
Pass credentials,
.\Deactivate-MobileBrowerView.ps1 -Url https://yoursitecollectionURL -Credentials (Get-Credential)
Solution | Author(s) |
---|---|
Deactivate-MobileBrowerView.ps1 | Rajesh Sitaraman |
Version | Date | Comments |
---|---|---|
1.0 | Apr 18 2016 | Initial release |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.