SOLVED

Disabling SharePoint Modern Experience Powershell

Iron Contributor

Does anyone know the command for disabling the SharePoint modern experience as the site collection level?

 

Microsoft has announced they are disabling the admin center setting and that it can be disabled at site collection level via powershell, but I cant find a command that resembles disable-modernexperience anywhere https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/Delivering-SharePoint-modern-experi...

 

Cheers

Alex

3 Replies
A quick search in the Internet can provide you some valid resources such as: https://blog.trigent.com/enabledisable-modern-ux-in-sharepoint-online-with-powershell-csom

Hi Juan Carlos

 

I appreciate the reply, but that way no longer works as the features are not present on the site collection or web.

 

Any other ideas?

 

Kind Regards

best response confirmed by NotAlex (Iron Contributor)
Solution

If anyone needs this for the upcoming disabling of the SharePoint tenant-optout for modern experience.

 

You can do it via SharePoint Online Management Shell with PNP installed

 

Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/siteurl -Credentials $cred

Enable-PnPFeature -Identity E3540C7D-6BEA-403C-A224-1A12EAFEE4C4 -Scope Site

 

Or Via CSOM C#

var siteFeatures = site.Features;

var switchToClassicFeatureID = new Guid("e3540c7d-6bea-403c-a224-1a12eafee4c4");
siteFeatures.Add(switchToClassicFeatureID, true,Microsoft.SharePoint.Client.FeatureDefinitionScope.None);

context.ExecuteQuery();

 

 

Main points here: you are activating a feature not disabling it, and the feature scope has to be set to "none" instead of "site"

 

 

 

 

 

1 best response

Accepted Solutions
best response confirmed by NotAlex (Iron Contributor)
Solution

If anyone needs this for the upcoming disabling of the SharePoint tenant-optout for modern experience.

 

You can do it via SharePoint Online Management Shell with PNP installed

 

Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/siteurl -Credentials $cred

Enable-PnPFeature -Identity E3540C7D-6BEA-403C-A224-1A12EAFEE4C4 -Scope Site

 

Or Via CSOM C#

var siteFeatures = site.Features;

var switchToClassicFeatureID = new Guid("e3540c7d-6bea-403c-a224-1a12eafee4c4");
siteFeatures.Add(switchToClassicFeatureID, true,Microsoft.SharePoint.Client.FeatureDefinitionScope.None);

context.ExecuteQuery();

 

 

Main points here: you are activating a feature not disabling it, and the feature scope has to be set to "none" instead of "site"

 

 

 

 

 

View solution in original post