SOLVED

Disabling SharePoint Modern Experience Powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-332571%22%20slang%3D%22en-US%22%3EDisabling%20SharePoint%20Modern%20Experience%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332571%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%20anyone%20know%20the%20command%20for%20disabling%20the%20SharePoint%20modern%20experience%20as%20the%20site%20collection%20level%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMicrosoft%20has%20announced%20they%20are%20disabling%20the%20admin%20center%20setting%20and%20that%20it%20can%20be%20disabled%20at%20site%20collection%20level%20via%20powershell%2C%20but%20I%20cant%20find%26nbsp%3Ba%20command%20that%20resembles%20disable-modernexperience%20anywhere%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FMicrosoft-SharePoint-Blog%2FDelivering-SharePoint-modern-experiences%2Fba-p%2F315023%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FMicrosoft-SharePoint-Blog%2FDelivering-SharePoint-modern-experiences%2Fba-p%2F315023%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EAlex%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-356472%22%20slang%3D%22en-US%22%3ERe%3A%20Disabling%20SharePoint%20Modern%20Experience%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-356472%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20anyone%20needs%20this%20for%20the%20upcoming%20disabling%20of%20the%20SharePoint%20tenant-optout%20for%20modern%20experience.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20do%20it%20via%20SharePoint%20Online%20Management%20Shell%20with%20PNP%20installed%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-PnPOnline%20-Url%20%3CA%20href%3D%22https%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fsiteurl%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftenant.sharepoint.com%2Fsites%2Fsiteurl%3C%2FA%3E%20-Credentials%20%24cred%3C%2FP%3E%3CP%3EEnable-PnPFeature%20-Identity%20E3540C7D-6BEA-403C-A224-1A12EAFEE4C4%20-Scope%20Site%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%20Via%20CSOM%20C%23%3C%2FP%3E%3CP%3Evar%20siteFeatures%20%3D%20site.Features%3B%3C%2FP%3E%3CP%3Evar%20switchToClassicFeatureID%20%3D%20new%20Guid(%22e3540c7d-6bea-403c-a224-1a12eafee4c4%22)%3B%3CBR%20%2F%3EsiteFeatures.Add(switchToClassicFeatureID%2C%20true%2CMicrosoft.SharePoint.Client.FeatureDefinitionScope.None)%3B%3CBR%20%2F%3E%3CBR%20%2F%3Econtext.ExecuteQuery()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMain%20points%20here%3A%20you%20are%20activating%20a%20feature%20not%20disabling%20it%2C%20and%20the%20feature%20scope%20has%20to%20be%20set%20to%20%22none%22%20instead%20of%20%22site%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355590%22%20slang%3D%22en-US%22%3ERe%3A%20Disabling%20SharePoint%20Modern%20Experience%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355590%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Juan%20Carlos%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20appreciate%20the%20reply%2C%20but%20that%20way%20no%20longer%20works%20as%20the%20features%20are%20not%20present%20on%20the%20site%20collection%20or%20web.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20other%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20Regards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-332626%22%20slang%3D%22en-US%22%3ERe%3A%20Disabling%20SharePoint%20Modern%20Experience%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332626%22%20slang%3D%22en-US%22%3EA%20quick%20search%20in%20the%20Internet%20can%20provide%20you%20some%20valid%20resources%20such%20as%3A%20%3CA%20href%3D%22https%3A%2F%2Fblog.trigent.com%2Fenabledisable-modern-ux-in-sharepoint-online-with-powershell-csom%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblog.trigent.com%2Fenabledisable-modern-ux-in-sharepoint-online-with-powershell-csom%3C%2FA%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted
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
Highlighted

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

Highlighted
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"