Articles taggés csv

Logo SharePoint

SharePoint 2010: Exporter en CSV la liste des pages de publication via Powershell

0

Si vous cherchez à récupérer la liste des pages de publication d’une collection de site, ce petit script vous aidera à le faire:

$CsvFileName = "PublishingPagesList.csv"
$CsvHeader = 'Site$MasterURL$URL$WebTemplate$Title$FileName$CT$Layout'

$CsvHeader | Out-File $CsvFileName
$site = Get-SPSite -Identity "http://mawebapp/macollection/"
$site | Get-SPWeb -limit all | ForEach-Object 
{
    if ([Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($_)) 
	{
        $publishingWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($_)
        $publishingPages = $publishingWeb.GetPublishingPages()
        foreach ($publishingPage in $publishingPages)
        {
            $_.Title  +"$"+ $_.MasterUrl +"$"+ $_.ServerRelativeUrl +"$"+ $_.WebTemplate`
			+"$"+ $publishingPage.Title +"$"+ $publishingPage.Name +"$"+ $publishingPage.ContentType.Name`
			+"$"+ $publishingPage.Layout.Name |Out-File $CsvFileName -append
        }
    }
    $_.Dispose()
}
$site.Dispose()
Haut de page