In SharePoint per attivare la feature di publishing su uno specifico web, puoi usare questo codice C#:

C#

string webUrl = "http://sharepoint.sgart.local/site1/subsite2";

Guid webPublishingGuid = new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb");  // PublishingWeb

using(SPSite site = new SPSite(webUrl)){
  using(SPWeb web = site.OpenWeb()){
    web.Features.Add(webPublishingGuid);
  }
}
oppure in PowerShell:

PowerShell

$webUrl = "http://sharepoint.sgart.local/site1/subsite2";

$webPublishingGuid = new-object Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"); 
$w = Get-SPWeb $webUrl
$w.Features.Add($webPublishingGuid);
Per funzionare deve essere attiva, a livello di site collection, la feature SharePoint Infrastructure Publishing (guid: F6924D36-2FA8-4f0b-B16D-06B7250180FA)
Tags:
C#236 PowerShell200 SharePoint498 SharePoint 2007218 SharePoint 2010224 SharePoint 2013137
Potrebbe interessarti anche: