Activate SharePoint server publishing infrastructure feature – When I was trying to activate the “SharePoint Server Publishing Infrastructure” feature in the SharePoint online communication site, getting the error – “Sorry, something went wrong An unexpected error has occurred. Technical Details, Troubleshoot issues with Microsoft SharePoint Foundation.“
Activate SharePoint server publishing infrastructure feature error
When we try to activate the SharePoint server publishing infrastructure feature, using the SharePoint manage feature page, we get an error.

The error message as below:
Sorry, something went wrong An unexpected error has occurred. Technical Details Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 04105b9f-f0c6-0000-3be6-10383379617d Date and Time: mm/dd/yyyy 6:22:38 AM
After some investigations got to know it is a known issue or expected behavior in the SharePoint online communication site because the “SharePoint Server Publishing Infrastructure feature” is not available on the communication site. Nevertheless, this issue does not happen only with the SharePoint online communication site, it also happens with the modern team site. So, in this troubleshooting blog – I will share how to activate the “SharePoint Server Publishing Infrastructure feature” on the SharePoint Online site when we face this issue.
![[Fixed] Error – activate the SharePoint Server Publishing Infrastructure feature in SharePoint Online site](https://i0.wp.com/global-sharepoint.com/wp-content/uploads/2020/06/Fixed-Error-–-activate-the-SharePoint-Server-Publishing-Infrastructure-feature-in-SharePoint-Online-site.jpg?resize=965%2C540&ssl=1)
Key Highlights: activate SharePoint server publishing infrastructure feature
- What is the publishing feature in SharePoint?
- What is the SharePoint server publishing infrastructure feature?
- Does the SharePoint server publishing infrastructure feature allow in the SharePoint Online communication site?
- How to activate the SharePoint server publishing infrastructure feature in SharePoint Online using the PnP PowerShell?
What is the SharePoint server publishing infrastructure feature?
SharePoint provides lots of in-built templates to create a site like a Team site, communication site, wiki site blog site, publishing site, etc. for each type of site has its own needs and scope in the business. If you want to create a public-facing site that mostly deals with the pages – then we go ahead to create the publishing site. However, if you are working with a team site or communication site, or any other types of sites and we need to have the publishing feature enabled, still we can have it by enabling the publishing feature in the SharePoint site collection and web level.
Technically, what does the publishing feature do in SharePoint?
SharePoint’s publishing infrastructure provides centralized libraries, content types, master pages, and page layouts and enables page scheduling and other publishing functionality for a site collection.
The publishing infrastructure can be enabled by activating features at both the site collection and site(web) level.
The two features are responsible for enabling publishing on a SharePoint site:
- SharePoint Server Publishing Infrastructure feature – site collection scope
- SharePoint Server Publishing – site or web scope
The first feature is the SharePoint Server Publishing Infrastructure feature that is activated at the site collection level. Once the “SharePoint server publishing infrastructure” feature is activated, then we need to activate the “SharePoint Server Publishing” feature at the site or web level.
What is the SharePoint Server Publishing feature in SharePoint?
By activating the “SharePoint Server Publishing” feature we can create a web page library as well as supporting libraries to create and publish pages based on page layouts.
Does the SharePoint server publishing infrastructure feature allow in the SharePoint Online communication site?
No, as per Microsoft the SharePoint server publishing infrastructure feature is disabled or hidden in the SharePoint Online communication site, which means technically it does not support the communication site. However, I personally not convinced – since the “SharePoint server publishing infrastructure” feature does not support the communication site why this option is being shown on the site collection feature activation page – the “SharePoint server publishing infrastructure” feature should have been hidden, in the communication site.

How to activate the SharePoint server publishing infrastructure feature in SharePoint Online using the PnP PowerShell?
Thanks, Microsoft for making our life easy by providing the PnP command, if we get an error while activating the “SharePoint server publishing infrastructure” feature in the SharePoint communication or team site, using the below PnP PowerShell script we can activate the “SharePoint server publishing infrastructure” feature in SharePoint Online
Activate publishing feature SharePoint online using PowerShell: Activate the SharePoint server publishing infrastructure feature in SharePoint Online using the PnP PowerShell
Using the below PnP PowerShell script we activate the publishing feature in SharePoint online:
#The below script is used to activate the SharePoint Server Publishing Infrastructure feature in SharePoint Online. cls $PSshell = Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorVariable err -ErrorAction SilentlyContinue if($PSshell -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } $fileName = "Activate SharePoint Server Publishing feature in SPO" #'yyyyMMddhhmm yyyyMMdd $enddate = (Get-Date).tostring("yyyyMMddhhmmss") #$filename = $enddate + '_VMReport.doc' $logFileName = $fileName +"_"+ $enddate+"_Log.txt" $invocation = (Get-Variable MyInvocation).Value $directoryPath = Split-Path $invocation.MyCommand.Path $directoryPathForLog=$directoryPath+"\"+"LogFiles" if(!(Test-Path -path $directoryPathForLog)) { New-Item -ItemType directory -Path $directoryPathForLog #Write-Host "Please Provide Proper Log Path" -ForegroundColor Red } #$logPath = $directoryPath + "\" + $logFileName $logPath = $directoryPathForLog + "\" + $logFileName $isLogFileCreated = $False function Write-Log([string]$logMsg) { if(!$isLogFileCreated){ Write-Host "Creating Log File..." if(!(Test-Path -path $directoryPath)) { Write-Host "Please Provide Proper Log Path" -ForegroundColor Red } else { $script:isLogFileCreated = $True Write-Host "Log File ($logFileName) Created..." [string]$logMessage = [System.String]::Format("[$(Get-Date)] - {0}", $logMsg) Add-Content -Path $logPath -Value $logMessage } } else { [string]$logMessage = [System.String]::Format("[$(Get-Date)] - {0}", $logMsg) Add-Content -Path $logPath -Value $logMessage } } ########################Activate the SharePoint Server Publishing Infrastructure feature in the site collection level############################## #Parameters area $siteURL = "YourSPOSiteURL" $featureID = "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" #Site collection level scoped publishing Feature ID $userName = "YourSPOUserName" $passWord = "YourSPOPassword" #Parameters area - Ends $encPassWord = convertto-securestring -String $passWord -AsPlainText -Force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord Try { Connect-PnPOnline -Url $SiteURL -Credentials $cred #Getting the site collection level feature by ID $feature = Get-PnPFeature -Scope Site -Identity $featureID #Getting the feature status with the feature definationId If($feature.DefinitionId -eq $null) { #SharePoint Server Publishing Infrastructure is being activated in the SPO site collection. Write-host -f Yellow "SharePoint Server Publishing Infrastructure is being activated in: "$SiteURL Enable-PnPFeature -Scope Site -Identity $featureID -Force Write-host -f Green "The SharePoint Server Publishing Infrastructure feature has been successfully activated Successfully!" } else { Write-host -f Yellow "The SharePoint Server Publishing Infrastructure feature is already activated in the " $SiteURL } } Catch { $ErrorMessage = $_.Exception.Message +"in activating the SharePoint Server Publishing Infrastructure feature!:" Write-Host $ErrorMessage -BackgroundColor Red Write-Log $ErrorMessage } ########################Activate the SharePoint Server Publishing Infrastructure feature in the site collection level - Ends here ############################## ########################Activate the SharePoint Server Publishing Infrastructure feature in the web level####################################################### #Parameters area $siteURL = "YourSPOSiteURL" $featureID = "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" #Web level scoped publishing Feature ID $userName = "YourSPOUserName" $passWord = "YourSPOPassword" #Parameters area - Ends $encPassWord = convertto-securestring -String $passWord -AsPlainText -Force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord Try { Connect-PnPOnline -Url $SiteURL -Credentials $cred #Getting the site collection level feature by ID $feature = Get-PnPFeature -Scope Web -Identity $featureID #Getting the feature status with the feature definationId If($feature.DefinitionId -eq $null) { #SharePoint Server Publishing Infrastructure is being activated in the SPO site collection. Write-host -f Yellow "SharePoint Server Publishing Infrastructure is being activated in(web level): "$SiteURL Enable-PnPFeature -Scope Web -Identity $featureID -Force Write-host -f Green "The SharePoint Server Publishing Infrastructure feature has been successfully activated Successfully(Web level)!" } else { Write-host -f Yellow "The SharePoint Server Publishing Infrastructure feature is already activated in the(Web level) " $SiteURL } } Catch { $ErrorMessage = $_.Exception.Message +"in activating the SharePoint Server Publishing Infrastructure feature(web level)!:" Write-Host $ErrorMessage -BackgroundColor Red Write-Log $ErrorMessage } ########################Activate the SharePoint Server Publishing Infrastructure feature in the web level - ends here###########################################
Summary: Activate SharePoint server publishing infrastructure feature
Thus, in this blog we have learned the below with respect to activating the SharePoint Server Publishing Infrastructure feature in SharePoint Online:
- What is the publishing feature in SharePoint?
- What is the SharePoint server publishing infrastructure feature?
- How to activate publishing features using PowerShell in SharePoint Online?
- Does the SharePoint server publishing infrastructure feature allow in the SharePoint Online communication site?
- SharePoint server publishing infrastructure vs SharePoint server publishing.
- How to activate the SharePoint server publishing infrastructure feature in SharePoint Online using the PnP PowerShell?
See Also: SharePoint Online Tutorial
You may also like the following SharePoint tutorials:
- [Fixed]: The page could not be created. Custom Scripting might be deactivated on the destination site or you might not have sufficient permissions.
- SharePoint Online: private vs public office 365 groups in SharePoint online site
- Export SharePoint user information list to CSV(Excel) file using PowerShell
- [Verified] How to redirect the specific user to a different page in SharePoint online?
- FAQ: SharePoint learning route for a junior developer(SharePoint skills matrix)
- Create custom property in SharePoint Framework – SPFx web part pane
- Understanding solution structure in SharePoint framework (SPFx)
- Develop your first hello world web part in sharepoint framework (SPFx)
- Column header formatting in SharePoint list Quick Edit or Datasheet View
- Enable and configure information rights management (IRM) in SharePoint Online
- Manage recycle bin in SharePoint Online – Office 365
- In 4 steps create office 365 trial account – sign up free subscription
- Add more than 5 conditions in InfoPath form’s rule
- How to validate the date column in Infopath form
- How to a copy list item to another list using SharePoint designer workflow
- SharePoint Framework (SPFx) development environment Setup step by step
- 3 ways add a picture library in the communication site – SharePoint Online
- SharePoint generation or version history from the year 2000 to 2020
- Office 365: Getting started with SharePoint PnP PowerShell – installation
- In 2 steps convert a classic SharePoint page to modern using PnP
- Office 365: Retrieve hub sites and associated sites using PnP Powershell
- Create a modern team site using PnP PowerShell in SharePoint
- In 4 steps access SharePoint online data using postman tool
- SharePoint admin center: Learn SharePoint online administration in an hour – step by step
- SharePoint REST API: GET vs POST vs PUT vs DELETE vs PATCH
- Office 365: Understanding the hub site in SharePoint online
- Create SharePoint online list using PnP provisioning template
- List Template IDs In SharePoint Online/SharePoint 2019/2016/2013/2010/2007
- Introduction to SharePoint information architecture
